Machine Problem VI, due Apr. 30

Part of the homework for CS:3620, Spring 2018
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Begin with the version of mush.shar distributed to the class with this assignment. This is yet another revision of MUSH, a cleaned up version of the solution to MP4 with slightly better error messages and code moved out of launch.c to make room for the changes you will need to make there.

Note this text from Homework 11 problem 2:

In the standard shells, if you type commanda|commandb, where the two commands may have any number of command-line arguments, commanda is launched with its standard output directed into a pipe, and commandb is launched in parallel with its standard input taken from that pipe.

Your goal in this assignment is to add shell pipes to MUSH. All the changes required will be confined to launch.c. To simplify the problem, note that MUSH pipes will be required to be separated from surrounding text by blanks, so in MUSH, this will work:

> cat launch.c | grep if

The result should print all of the lines containing if found in the file launch.c. It will work equally well in any of the standard Unix/Linux shells.

As usual, your code should be decently commented and formatted. The usual penalties apply to overlength lines, improper attribution, missing comments, excessively wordy comments, and other issues of program style.

Your solution must be in a file named launch.c (all lower case). Submit your solution using the coursework submission tools documented at:


In short, you will type the shell command submit, with no arguments, and when it prompts for a file name, you will type launch.c. and then an extra carriage return to indicate that there is only one file in your submission. When it prompts for a course, type CS3620 and when it prompts for an assignment directory, enter mp6.

Note, file names on Unix/Linux systems are case sensitive! That includes the course name. If you type cs3620, it will not work. If you type CS:3620, it will not work.