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 Lab9 we did the 3 built-in 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 Lab10
main/lab10.c 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 csc60
Type: cp -R /home/college/bielr/files_csc60/lab10.
Spaces needed: (1) After the cp Dont miss the space & dot.
(2) After the -R
(3) After the directory name at the end & before the dot.
You have now created a lab10 directory and copied in Lab10 functions:
lab10.c, ParseCmd.c, ProcessExtCmd.c, lab9_10.h,
RunExtCmd.c, Redirection.c (These last two are started and you must finish them.)
Stay in directory csc60, and you need to
type: chmod 755 lab10// makes the directory accessible
type: cp lab9/lab9.c lab10/lab10.c // copies lab9.c into lab10.c
CSC 60. Fall 2023. Lab 10. Write your own UNIX Shell, part 2.
Page 2 of 8.
We have copied lab9 code and renamed it to lab10.c for you to start work on it
Next move to lab10 directory by typing: cd lab10
and then type: chmod 644*
This will set permissions on all the files.
Your new lab10 directory should now contain:
lab10.c, ParseCmd.c, ProcessExtCmd.c, lab9_10.h,
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 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!