Design and implement a better Command Shell

Design and Implement a simple shell for Linux on our Lab machines. The shell should

  1. Parse the command line
  2. Create and execute a process for each command (and its arguments) on the command line. You need to support a minimum of three commands on the command line. A command is separated from the next by
  3. Support foreground and background processes
  4. Support a ">" or "<" sign indicating I/O redirection to from a file
  5. support a builtin command "exit" that quits the shell.
Note that if you have three commands connected by a pipe, the first command (write end of pipe) cannot do output redirection while the third (last) command (read end of pipe) cannot do input redirection. The middle command cannot redirect input or output.

Graduate students will

The objective is to:

You will create a tarred, gzipped file named as2.tgz containing
  1. your source code files
  2. a readme, and
  3. a Makefile to make your executable.
Your source should compile and run without errors on our Linux lab machines. Here is a sample makefile.

Turn in your tarred, gzipped file by emailing it as an attachment to

cs446@cs.unr.edu

You can run an executable that implements the needed parsing at

	% /cs/cs446/bin/shell
    
You will need to duplicate most of the functionality that you see. Here is sample code: You can save, compile, and execute these programs to see what they do.
Sushil Louis
Last modified: Mon Feb 9 12:38:18 PST 2004