Computer Science 322
Operating Systems

Mount Holyoke College
Spring 2010

Lab 2: The Lyon Shell
Due: 2:40 PM, Monday, February 22, 2010

For this lab, you are to write a C program called the Lyon Shell (lysh), a mini command shell interpreter. lysh is similar to familiar Unix shells such as the Bourne shell (sh) the Bourne-Again shell (bash), and C shell (csh, tcsh). You will learn about process creation, pipes, input/output redirection, background process management, signals, and interrupt handling, and gain extensive experience with C.

You may work in groups of size 2 or 3. Collaboration within a group is, of course, unrestricted. You may discuss the program with members of other groups, but what you turn in must be your own group's work. Groups must be formed no later than 2:40 PM, Wednesday, February 10, 2010, and be confirmed by all group members by electronic mail to jteresco AT All group members will be assigned the same grade for the lab. There are many subtasks that can be carved off and assigned to group members, so everyone is encouraged to join a group.


Like the Unix shells you use every day, lysh should issue a prompt (below, it is "shell#"), at which it reads commands from the user and executes them.

Your shell should interpret the following commands and provide the following functionality:


Submission and Evaluation

All necessary files should be submitted in a single tar file shell.tar. Include a Makefile to allow easy compilation of the Lyon Shell program. Send this tar file as an attachment to jteresco AT by 2:40 PM, Monday, February 22, 2010.

I will compile and test your shell programs on the FreeBSD system, mogul.

Your program will be graded based on a total of 50 points.

Penalties may be applied for poor design choices, poor formatting of code, poor programming style, or if your program compiles with warnings (when using gcc -Wall).

Have fun and good luck!