CS 702 - Operating Systems - Spring 2004
Project 1


Loyola College > Department of Computer Science > Dr. James Glenn > CS 702 > Projects > Project 1

Due

Tuesday, February 10th 17th at 11:59pm. Projects will be penalized 20% for each day after the due date. Projects will not be accepted more than four days late.

Objectives

Assignment

Add pipes and input and output redirection to your shell.

Your shell should repeatedly display a prompt and allow the user to enter a command to run. Your shell should terminate at the end of user input (Control-D sends EOF to an interactive Unix process). The commands may consist of a single program name with arguments, or any number of program names and arguments chained together with the pipe symbol ('|'), which indicates that the standard output of the previous program in the chain should be fed in as standard input to the next program. In addition, user should be able to specify an existing file to use in place of the first program's standard input and/or a file to use in place of the last program's standard output. In each case the name of the file will follow a redirection symbol ('<' for input, '>' for output) after the list of arguments. You should assume that each part of a command is separated by at least one space character.

For example, your shell should be able to process the following commands.

date
cal -3 12 2003
grep throw < shell.cpp
grep throw > matches
grep throw < shell.cpp > matches
cat shell.cpp | grep throw | wc
cat < shell.cpp | grep -v throw | wc > out

You need not do anything special with quoted arguments, escape characters, or any special symbols that "real" shells allow (for example, >> or >&).

Grading

For full credit, your shell should meet the following criteria:

Submissions

Submit an archive containing the files necessary to build and run your completed program. Send the archive as an attachment to an e-mail sent to jglenn@cs.loyola.edu.