Question
Write shell program using in C, using various Unix system calls, such as fork , execv , wait , etc. to accomplish the following tasks:
Write shell program using in C, using various Unix system calls, such as fork, execv, wait, etc. to accomplish the following tasks:
Once executed in your home directory, it should switch to your Name%. For example, if your login name is ksmith,
/home/ksmith> shell.c
/home/ksmith%
It can execute the following Unix commands ls, pwd, cd, more, quit, as well as a compiled c program, hello_world, that simply prints out “Hello world!”.
It can look for the above compiled program if it is not located in the same directory as where your shell program is located, but in a child directory.
Create delDir, which will delete a non-empty directory, which might itself contain nonempty directories.
Create accessRightDir, which will list the access rights of all of its sub directories as well as files.
Once the quit command is executed, it should return to your home directory,
Step by Step Solution
3.57 Rating (161 Votes )
There are 3 Steps involved in it
Step: 1
Below is a simple example of a shell program in C that uses various Unix system calls to accomplish ...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