Question: UNIX Shell In Lab 9 we did the 3 built - in commands: cd , pwd , exit. Now we need to implement: a fork,
UNIX Shell
In Lab we did the builtin commands: cd pwd exit.
Now we need to implement: a fork, an exec, and code to handle redirection.
Makeshift Pictorial of the calling sequence of Lab
mainlabc PS: Box indicates a function.
ParseCmd ProcessExtCmd
Call fork
Parent does Wait Child Process
RunExtCmd
Redirection
Call execvp
FILES TO COPY Different Instructions this time:
To get the file you need, first move to your class folder by typing: cd csc
Type: cp R homecollegebielrfilescsclab
Spaces needed: After the cp Dont miss the space & dot.
After the R
After the directory name at the end & before the dot.
You have now created a lab directory and copied in Lab functions:
labc ParseCmd.c ProcessExtCmd.c labh
RunExtCmd.c Redirection.c These last two are started and you must finish them.
Stay in directory csc and you need to
type: chmod lab makes the directory accessible
type: cp lablabc lablabc copies labc into labc
CSC Fall Lab Write your own UNIX Shell, part
Page of
We have copied lab code and renamed it to labc for you to start work on it
Next move to lab directory by typing: cd lab
and then type: chmod
This will set permissions on all the files.
Your new lab directory should now contain:
labc ParseCmd.c ProcessExtCmd.c labh
RunExtCmd.c Redirection.c These last two are started and you must finish them.
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
