Answered step by step
Verified Expert Solution
Link Copied!

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 C to pass the following test cases. Be sure to use execv()
Instead of execvp(). Do not hard code paths. /bir/ls should come from a search
from paths. The same goes for the testing folder.
Test 1:
1.desc - Input to check bad od. No arguments are passed to cd.
1.err - An error has occurred
1.in - cd
exit
1.out -
Test 2:
2.desc -2 arguments are passed to cd.
2.err - An error has occurred
2.in - cd /bad1/bad2
exit
2.out -
Test 3:
3.desc - Is with a bad directory name.
3.err -Is: /no/such/file: No such file or directory
3.in - Is inolsuch/file
exit
3.out -
Test 4:
4.desc - Input to run misc. commands.
4.err -
4.in - cd tests/p2a-test
Is
4.out - test1
test2
test 3
test4
Test 5:
5.desc - Tries to exit with an argument. Should throw an error.
5.err - An error has occurred
5.in - exit bad
exit
5.out -
Test 6:
6.desc - Try running a shell script without setting path.
6.err - An error has occurred
6.in -
p1.sh
exit
6.out -
Test 7:
7.desc - Set path, run a shell script. Overwrite path and then try running the script again.
7.err - An error has occurred
An error has occurred
7.in - path tests
p1.sh
path
p1.sh
Is
exit
7.out - test1
test2
test 3
test4
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data With Hadoop MapReduce A Classroom Approach

Authors: Rathinaraja Jeyaraj ,Ganeshkumar Pugalendhi ,Anand Paul

1st Edition

1774634848, 978-1774634844

More Books

Students also viewed these Databases questions

Question

Explain Enrons abuse of mark-to-market accounting.

Answered: 1 week ago

Question

4. Label problematic uses of language and their remedies

Answered: 1 week ago