Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a basic shell in C to pass the following test cases. Be sure to use execv ( ) Instead of execvp ( ) .
Create a basic shell in to pass the following test cases. Be sure to use execv
Instead of execvp Do not hard code paths. birls should come from a search
from paths. The same goes for the testing folder.
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 inolsuchfile
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started