Smart Shell, Part III (Optional)

This is an individual optional assignment that may contribute up to 60 bonus points to your assignment score.

What To Do

  1. Add functionality to your smartshell so that the user can redirect the standard input and standard output using the '<' and '>' characters. For example:
        myshell$ pwd > out.txt
        myshell$ more out.txt
    will place the output of the Hello World into the out.txt file. In this case, the child executing the command will need to redirect stdout to the file.

  2. Add functionality to your smartshell to execute piped commands using the '|' operator. For example:
        myshell$ more out.txt
        myshell$ more out.txt | wc -l
    In this case, your shell will need to create a pipe and fork two children that communicate via the pipe. The child executing the first command should redirect stdout to the write end of the pipe, and the child executing the second command should redirect stdin to the read end of the pipe.

    Make sure that the parent and the children close the ends of the pipe they are not using, otherwise you will run into EOF problems with the pipe and the children will not terminate their execution.

What to Submit

In your smartshell directory create a text file named readme (not readme.txt, or README, or Readme, etc.) that contains:
  1. Your name(s) and assignment number.
  2. The machine you used to complete the assignment (i.e, tanner or your own machine). If you used your own machine, please be ready to demo your code to your TA or your instructor at any time upon request.
  3. An indication of how much time you spent doing the assignment outside of class.

Turn in a printout copy of the readme and smartshell.c files, and a sample output.

Leave the source code in your directory systems/smartshell. Do not make any changes to these files after the due date for this assignment. If you wish to continue working on these exercises after the due date, make a copy of your directory smartshell using the following Unix command:

    cp -r ~/systems/smartshell ~/systems/smartshell-copy3
A new directory called smartshell-copy3 will be created in your systems directory. You may now make any changes you want to the files in your smartshell-copy3 directory, at any time.


No credit will be given for code that does not work as expected.
60     Total points possible
30 Redirection works as expected
30 Piped commands work as expected

Have fun!