CSCI 340 Operating Systems Program Assignment 1

$25.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (3 votes)

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
command.
9. terminates the command input loop if the first token is “exit”. LINUX is case sensitive.
Grading Rubrics per Numbered Requirements:
Test Script:
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
date
cal
pwd
ls -l
cat test.txt
wc test.txt
wc -l test.txt
cal > calOut.txt
cat calOut.txt
sleep 5
sleep & 5 SHOULD NOT RUN IN BACKGROUND SINCE & IS NOT LAST
sleep 5 &
ps TYPE THIS QUICKLY SO WE CAN SEE THE SLEEP PROCESS
exit
Submitting programs:
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.