This is an individual optional assignment that may contribute up to 60 bonus points to your assignment score.
myshell$ pwd > out.txt myshell$ more out.txt /Users/mdamiani myshell$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.
myshell$ more out.txt /Users/mdamiani myshell$ more out.txt | wc -l 1 myshell$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.
smartshell
directory create a text file named readme
(not readme.txt
, or README
, or Readme
, etc.)
that contains:
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-copy3A 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 |