You are creating a shell based on the description given in Chapter 2 Part A (page 77) in the Kernel Projects book. Your shell will parse an input. The first argument is the command to be run. The...

You are creating a shell based on the description given in Chapter 2 Part A (page 77) in the Kernel Projects book. Your shell will parse an input. The first argument is the command to be run. The entire command will be read from the user, after a prompt is printed out. Your command will be limited to 200 characters and it will have no additional spaces in the command. You need to place your program in a loop such that it will re-read a new command after the previous command has terminated. You must use the system calls fork, execv and wait. You may use the string functions strcat, strlen and strncmp. The rest should be done by hand.

Astarter filehas been provided that includes the recommended order in which you should complete each step of the program. It can be found in the Files page, as well as an example of printing the environment variables.



Examples:





Additional Resources:


Check if file exists:


http://stackoverflow.com/questions/230062/whats-the-best-way-to-check-if-a-file-exists-in-c-cross-platform(Links to an external site.)





Your program must compile. Failure to do so will result in 0 points.


Turn in: A file named project2.c






May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here