Question: hi can someone help me ammed this code so that it does the following instead? The following are the major tasks you need to perform:
The following are the major tasks you need to perform: 1. The first program is called simple_shell and it is included in the file named simple shell.cpp. The program reads a shell command from the user and executes it using the system call execvp. The program is designed to execute one command and then exits. What you need to do is to make the program run forever using an infinite loop, until a termination condition is triggered. Within the loop the program should execute in the following sequence: 1. Read command from user. [Already provided] 2. Cut up the command into argument list. [Already Provided] 3. If the command is equivalent to "exit" break the loop and exit; you can use strcasecmp to check that. Else fork a new child to execute the command and wait for the child until it finishes 4. 5. The child should use execvp. [Already provided] 6. Repeat the sequence again. include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
