Description: Design, code, and test your own LINUX/UNIX interactive console shell.
Requirements – The shell program…
1. must be written in C and must compile and run on LINUX Mint.
2. displays a distinctive input prompt such as > $ %
3. accepts user command input on a single line of text ended by [ENTER]
4. accepts user commands comprised of a LINUX command that may be followed by one or
more arguments, each separated by at least one blank space.
5. tokenizes or splits space-separated tokens into a list of arguments.
6. uses the fork and execvp system calls to run the LINUX command as a child process.
7. waits for the child process to complete if the ampersand character & is the last token of a
command and after that child completes, the shell goes on to display the next input
prompt and await another command.
8. does not wait for the child process to complete if the ampersand & is the last token of a
command and immediately goes on to display the next input prompt and await another
9. terminates the command input loop if the first token is “exit”. LINUX is case sensitive.
Grading Rubrics per Numbered Requirements:
Create a short plain text file called text.txt.
Test your shell by entering the following series of LINUX console commands. Copy the
console window trace and paste it into a plain TXT file named trace.txt
wc -l test.txt
cal > calOut.txt
sleep & 5 SHOULD NOT RUN IN BACKGROUND SINCE & IS NOT LAST
sleep 5 &
ps TYPE THIS QUICKLY SO WE CAN SEE THE SLEEP PROCESS
Please create a single ZIP or TAR archive that contains your single .c source file named shell.c
and your trace.txt text file.
Please upload this archive file into OAKS dropbox prior to start of class on the due date.