Question: You need to take user input as we did in shell ( any five commands of your choice from Lab 1 along with a .
You need to take user input as we did in shell any five commands of your choice from Lab
along with aout file that contain any code such as argument display or hello world
and according to the given input,
first you need to create the child process
and then you need to display the command output accordingly.Program would terminate when user enter "Exit".
Incase of invalid input you need to print "invalid argument" and
error in case of exec failure or fork.
For this task you need to use atleast four family function of exec.
pfork;
ifp
child
get user input a for example ls
or use case ifals
execbinlslsdirNULL
else
execvp
elseifcat
execlp
elseif
parent
waitNULL
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
