Question: C program only; fill in the code Create a basic shell script Your shell needs to output Your Command > and read in the input

 C program only; fill in the code Create a basic shell

script Your shell needs to output Your Command > and read in

C program only; fill in the code

the input that is being fed in Example: Your Command > Is

Create a basic shell script Your shell needs to output Your Command > and read in the input that is being fed in Example: Your Command > Is Input: Is, Is&, and S You must include a fork and the child process should execute the command If there is a '&', the parent process should go always go first The child process should go when 'Is' is written O Your command> ls CHILD Makefile build dist main.cnbproject stdout.txt WAITED PARENT Your command> & PARENT CHILD Your command> PARENT Your command> 15& PARENT CHILD Your command> Makefile build dist PARENT main.c nbproject stdout.txt Your command> 1 int main (int argc, char while (1) { argcv) { (...) //variables while { 1/Get input command and gives it to cmd array } (...) // delimiter for cmd array if { // Indicate if '&' character found, do not wait for child process // Remove '&' from command line } (...) Il create child process (using fork()) if { llerror if child process is less than 0 } else if { Il child_pid == 0, do child process and execute command } 1/ parent process waits for child process unless flag is present } } return (EXIT_SUCCESS); } Create a basic shell script Your shell needs to output Your Command > and read in the input that is being fed in Example: Your Command > Is Input: Is, Is&, and S You must include a fork and the child process should execute the command If there is a '&', the parent process should go always go first The child process should go when 'Is' is written O Your command> ls CHILD Makefile build dist main.cnbproject stdout.txt WAITED PARENT Your command> & PARENT CHILD Your command> PARENT Your command> 15& PARENT CHILD Your command> Makefile build dist PARENT main.c nbproject stdout.txt Your command> 1 int main (int argc, char while (1) { argcv) { (...) //variables while { 1/Get input command and gives it to cmd array } (...) // delimiter for cmd array if { // Indicate if '&' character found, do not wait for child process // Remove '&' from command line } (...) Il create child process (using fork()) if { llerror if child process is less than 0 } else if { Il child_pid == 0, do child process and execute command } 1/ parent process waits for child process unless flag is present } } return (EXIT_SUCCESS); }

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!