Question: Create a basic shell program in C called wish to pass the following test cases. Be sure to use execv ( ) instead of execvp
Create a basic shell program in called wish to pass the following test cases. Be sure to use execv instead of execvp Do not hard code paths. binls should come from a search from paths. The same goes for the testing folder. There should be a main.c common.c and common.h
The following are the tests to pass.
Test :
desc Input to check bad od No arguments are passed to cd
err An error has occurred
in cd
exit
out
Test :
desc arguments are passed to cd
err An error has occurred
in cd badbad
exit
out
Test :
desc Is with a bad directory name.
err Is: nosuchfile: No such file or directory
in Is nosuchfile
exit
out
Test :
desc Input to run misc. commands.
err
in cd testspatest
Is
out test
test
test
test
Test :
desc Tries to exit with an argument. Should throw an error.
err An error has occurred
in exit bad
exit
out
Test :
desc Try running a shell script without setting path.
err An error has occurred
in psh
exit
out
Test :
desc Set path, run a shell script. Overwrite path and then try running the script again.
err An error has occurred
An error has occurred
in path tests
psh
path
psh
Is
exit
out test
test
test
test
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
