For this assignment, you are to design a simple shell which implements a subset of the functionality of the Bourne Again Shell (Bash). The requirements for your shell are as follows:
• Continually prompt for textual user input on a command line.
• Parse user input according the provided grammar (see below)
• When a user enters a well formed command, execute it in the same way as a shell. You must use the commands fork and exec to accomplish this. You may NOT use the C++ system() command.
• Allow users to pipe the standard output from one command to the input of another an arbitrary number of times.
• Support input redirection from a file and output redirection to a file.
• Allow users to specify whether the process will run in the background or foreground using an ’&’. Backgrounding processes should not result in the creation of zombie processes. (Commands to run in the foreground do not have an ’&’, and commands that run in the background do)
• Print a custom prompt which supports printing the current directory, user name, current date, and current time.
• (Bonus) Allowing $-sign expansion. See the last sample command in the list of commands for example.
Write a report describing your design for piping, redirection and other special techniques that you are unique to your implementation. No need to restate the obvious.