Limited Shell
Description
Assignment #5 Instructions: Limited Shell
Through this programming assignment, the students will learn to do the following:
Work with processes using fork, pipe, wait, dup2, and the exec system calls.
Additional practice with a Makefile with an all target
Work with the different address spaces
The main idea of this assignment is to write a limited function shell that only runs a few programs from a menu.
Write 4 small programs to start with followed by the menu program called newshell.
1. letters
One program will output the letters in the alphabet to the screen. Make sure they are printed one at a time, one per line.
Usage would be: letters
Output would be:
A
B
C
Etc.
2. numbers
Program 2 would print the numerals 0-9 to the screen. Make sure they are printed one at a time, one per line.
Usage would be: numbers
0
1
2
Etc.
3. firstname
Program 3 would print out your first name which is passed in as an argument on the command line. This would go to the screen.
Usage would be: firstname yourfirstname
4. userinput
Program 4 will accept alphabetic input from the user via stdin change it to all capital letters and print it to the screen.
Usage would be: userinput
5. newshell
Write a parent program similar to myshell.c but called newshell which will allow the user to choose from a menu of options.
Usage would be: newshell
1 letters
2 numbers
3 firstname
4 userinput
5 letters > filename (letters redirected to a file)
6 letters | userinput (letters piped to userinput)
7 firstname | userinput (names piped to userinput)
8 exit (your program should end by leaving the infinite loop.)
These programs should be completed with the process commands fork, pipe, wait, dup2, and the 6 exec programs. The newshell program should not run any of the other programs, it should fork off children to run the programs.
Do not use any system calls. Make sure you close all file descriptors before the program ends.
Your program will earn points based upon the number of menu items that run properly.
You will need a Makefile with an all target to compile all the programs.
Please submit your work as one zip file. Follow the instructions below carefully (to avoid unnecessary loss of grade):
You should submit the source code and the Makefile a zip file. One should be able to create all the executables by simply ‘make’. The Makefile should also contain a ‘clean’ target for cleaning up the directory (removing all object files at a minimum). Make sure you don’t include intermediate files: .o, executables,~, etc., in your submission. (There’ll be a penalty for including unnecessary intermediate files or folders). Six files should be included unless permission is given for more, those would be letters.c, numbers.c, firstname.c, userinput.c, newshell.c, and Makefile.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."