Question: Write a c shell program to incoorperate the commands cd , exit , ls , and path. For ls and path, do not hard code
Write a c shell program to incoorperate the commands cd
exit ls
and path. For ls and path, do not hard code paths. Paths should be found from a search for paths. Also use execv instead of execvp. The following should be able to be taken as an input and produce the following output.
input:
cd tests
p
a
test
output:
test
test
test
test
input:
ls
no
such
file
exit
output:
ls:
no
such
file: No such file or directory
input:
path tests
p
sh
path
p
sh
ls exit
output:
An error has occurred
An error has occurred
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
