CS60 Homework Assignment 9 ----------------------------- Due: Oct 29th at 1:00pm Pipe! --------------------- The task of homework 9 is to create a program that takes two commands as arguments, creates a pipe, redirects the standard out from the first process to the standard in of the second, and executes the processes. This is exactly what happens when a shell is given a command of the form: cmd1 | cmd2 And if completed, should aid in the completion of project3's extra credit opportunity. You program should perform simple error checking for the following cases: 1.) user has not specified two commands to execute 2.) commands cannot be executed by execv() Hints ----------------- Read the book and look at the manpages for fork(), dup2(), and execvp(). Turnin ------------------ The turnin tag for this assignment is 'hw9' and must include the code, a scriptfile showing compilation and execution of the program with at least the 'ls' and 'wc' commands as arguments to your program, as well as the 'ls | wc' command at a shell prompt. For compilation, you must show your program compiling with the '-ansi -pedantic' flags to gcc. You may include an optional README file with special instructions for the grader. Sample Output ------------------ [nurmi@localhost hw9]$ gcc hw9.c -o hw9 [nurmi@localhost hw9]$ ./hw9 USAGE: ./hw9 [nurmi@localhost hw9]$ ./hw9 ls USAGE: ./hw9 [nurmi@localhost hw9]$ ./hw9 ls wc 9 9 71 [nurmi@localhost hw9]$ ls | wc 9 9 71 [nurmi@localhost hw9]$