Write a simple shell in a systems programming language.
What is a systems programming language? For our purposes, any language with the POSIX fork(), exec(), and pipe() functions will work. These functions are only implemented in C, but many languages have straightforward bindings to them. I recommend one of the following languages:
If you want to use another language, please ask me first. In reality, most of your program will involve using the same C functions as everyone else, so your favorite language won't really help you much.
Your shell will be a program that loops until the user types "exit" or hits Ctrl-D (End Of File). Each line of input will be interpreted as a command in the form:
When the user enters a command, you are to run the specified program using the POSIX exec*() family of functions, passing any specified arguments to the program. After the program terminates, your shell should continue accepting input.
Your shell must also accept reading from file input. To test your program, create a simple shell script and run it using your shell:
Make sure to design your code well, because we will be adding many features to the shell over the next few weeks. If you finish these requirements early, I recommend you begin adding features to make your shell more shell-like.