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 tests/p2a-test
output:
test1
test2
test3
test4
input:
ls /no/such/file
exit
output:
ls: /no/such/file: No such file or directory
input:
path tests
p1.sh
path
p1.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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!