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
2
a
-
test
output:
test
1
test
2
test
3
test
4
input:
ls
/
no
/
such
/
file
exit
output:
ls:
/
no
/
such
/
file: No such file or directory
input:
path tests
p
1
.
sh
path
p
1
.
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!