Project 3
Create a program shell that does the following:
- Reads the user input and treats it as a command to execute - the first word in the command line is the name
of the command to run and the other words are the arguments of the command
- Executes the specified command with the given arguments
- If in the command line there is the symbol < (less sign), then the word after the sign is to be
treated as a name of the file. In this case, the program's standard input has to be re-directed and the program
should read from the file specified
- If in the command line there is the symbol > (greater sign), then the word after the sign is to be
treated as a file name. In this case, the program's standard output has to be re-directed to the file specified.
- If none of these symbols are present, then the program inherits the shell's standard input and
output.
- Once the command is executed, the shell program should wait for this command to stop and then prompt
the user for the next command.
- The following words if appears at the beginning of the command line should not be treated as name of the command
to execute:
- shell - starts another copy of the shell program in a separate console window
- exit - terminates the shell program
- nohup - will be explained later
- kill - will be explained later
- killall - will be explained later
- time - will be explained later
- ps - will be explained later
Due day is Monday February 17-th, 2003 at 11:59pm.