CSCI212/MCS9212
Assignment 3 (7.5 marks)
Due 11:59pm Sunday May 17, 2015.
The aim of this assignment is to write a simple shell interpreter demonstrating you knowledge of process
control. In addition to this you will get some experience with file system API’s.
Task One (4.5 marks)
You first task is to write a simple shell interpreter, which executes commands. You shell interpreter should
display a $ prompt and wait for user input.
You shell interpreter is to be a little simplistic, all you can do is execute commands. If a command cannot be
found you should display a suitable error message. When executing a command the shell interpreter should
wait until the command terminates. To implement command execution simply use the function call fork()
and exec(). Note that there are many variations on the exec() function call. To block the shell, you
should use the wait() (or similar) function call.
At the end of this step you should be able to do this:
$ ./foobar
./foobar does not exist.
$ ls