CS 450 Homework 2

Links: [Course Home] [Schedule] [Learning Objectives] [Resources] [Moodle]


Due Wednesday, March 22 at 10:00 AM. There is an automatic grace period of 24 hours associated with this deadline. This is the only consideration that will be given for minor emergencies.

You may work in groups of up to three students. Please have just one group member submit the assignment (see instructions below).

As a reminder, the course collaboration policy will be strictly enforced on this assignment.

Project Description

For this project, you are to write a simple shell-like program in C that reads user commands and executes them using a combination of "fork", "exec", and "pipe".

Basics

Sample Commands

Your shell should be able to handle commands of the following types. I recommend developing your code in this order, but it's not required:

Starter Code

To get started, copy the files in ~srivoire/cs450/pickup/hw2 to your directory on the CS department server (blue.cs.sonoma.edu). You should have the following files, which you can use as a basis for your code:

Grading Criteria

Processing simple commands with no redirection5 points
Processing commands with one pipe10 points
Processing commands with two pipes10 points
Processing commands with an arbitrary number of pipes20 points
Processing simple commands with input and/or output redirection20 points
Processing commands combining pipes and input and/or output redirection20 points
Error handling (see "Basics")5 points
Design and style (see below)10 points
Total for assignment 100 points

Design and style will be assessed on the following criteria:

Submission

In addition to your source files, your submission should include a makefile and a file named groupmembers.txt listing your group members (unless you worked by yourself).

Run "make clean" before submitting. Then, back up to your parent directory and run

tar czvf hw2.tgz yourdirectory

Submit your tarfile on Moodle.