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 forkexecwait Your program will repeatedly:
Prompt the user for a command assume there are no arguments if the command is exit, quit
spawn a child
wait
Each child will
try to call some form of exec to run the command
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
