Question: Create a simple Shell in C: Come up with a simple shell program in C, using various unix system calls, such as fork, execv, wait,

Create a simple Shell in C:

Come up with a simple shell program in C, using various unix system calls, such as fork, execv, wait, etc. to accomplish the following tasks: 1. Once executed in your home directory, it should switch to yourName%. For example, if your login name is jdoe, /home/jdoe> shell /home/jdoe%

2. It can execute the following UNIX commands ls, pwd, cd, more, quit, as well as a compiled c program, I_did_it, that simply prints out I did it!.

3. It can look for the above compiled program if it is not located in the same directory as where your shell hides, but in a child directory.

4. Your shell can do one of the following: delDir, which will delete a non-empty directory, which might itself contain nonempty directories. accessRightDir, which will list the access rights of all of its sub directories as well as files.

5. Once the quit command is executed, it should return to your home directory, i.e., /home/jdoe%quit /home/jdoe> You also need to attach to your shell a readable and detailed documentation that specifies which part of your code does the following: print out the custom made prompt; get in the command line; parse the command line; execute the command line; and return back to the normal prompt.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!