Question: Write a c shell program to incoorperate the commands cd , exit, ls , and path. For ls and path, do not hard code paths.
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 testspatest
output:
test
test
test
test
input:
ls nosuchfile
exit
output:
ls: nosuchfile: No such file or directory
input:
path tests
psh
path
psh
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
