Question: Write a simple shell program using fork / exec / wait . Your program will repeatedly: 1 . Prompt the user for a command (

Write a simple shell program using fork/exec/wait. Your program will repeatedly:
1. Prompt the user for a command (assume there are no arguments), if the command is exit, quit
spawn a child
wait
Each child will
1. try to call some form of exec to run the command
2. if exec fails, the child prints "command failed" and ends

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!