Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started