CS 284 Operating Systems
Programming Assignment #4

Due: 9/12/2001 - Class Time

You should review in the man pages

Write a C program (Prog4a.c) that mimics the program cat. i.e.

while (not EOF of stdin)
     scanf(the content of stdin)
     printf(everything read by scanf) 

Write a C program (Prog4b.c) that will accept command line arguments of the following types

ShellPrompt> Prog4b Prog4a

  1. this means that Prog4b should fork() and exec(Prog4a).
  2. Prog4b should wait() for 4a to exit() before it exit()s

ShellPrompt> Prog4b Prog4a < fileABC

  1. prior to the step #2, 4b should
  2. 4b should fork() and exec(4a).
  3. 4b should wait() for 4a to exit() before it exit()s

ShellPrompt> Prog4b Prog4a < fileABC > fileXYZ

  1. prior to the step #2, 4b should
  2. 4b should fork() and exec(4a).
  3. 4b should wait() for 4a to exit() before it exit()s

ShellPrompt> Prog4b Prog4a > fileXYZ

  1. prior to the step #2, 4b should
  2. 4b should fork() and exec(4a).
  3. 4b should wait() for 4a to exit() before it exit()s

=================================================================

NOTEs:

You should use the 'script' command to capture all necessary information for handin.