11. Processes

<!> Create 11_Processes subdirectory at sugon server and store all the code there.

Write 4 programs:

  1. outredir.c command output_filename, execs a command with stdout redirected to output_filename

    • e. g.: ./outredir ls out_of_ls

  2. allredir.c command infile outfile, forks and execs a command with both stdin and stdout redirection, then waits for it to terminate and printfs WEXITSTATUS(wstatus) received

    • e. g. ./allredir hexdump out_of_ls dump_file

  3. argredir.c infile outfile command arg1 arg2 arg2 ...: rewrite previous program, but use execvp() for executing command with arguments

    • e. g. ./argredir out_of_ls dump_file hexdump -C

  4. piperedir command1 command2 arg1 arg2 arg3 ..., forks and execs command1, then execs command2, connecting them through unnamed pipe

    • e. g. ./piperedir date hexdump -C

H/W

HSE/ProgrammingOS/Lab_11_Processes (последним исправлял пользователь FrBrGeorge 2020-05-08 12:06:29)