Question: Hi I am trying to create a runnable shell program and this is what i have so far, but it isn't working. Can you please
Hi I am trying to create a runnable shell program and this is what i have so far, but it isn't working. Can you please help me edit it so that it does work? and also help me add the function to run the commands?
//repeat forever for ( ; ; ) { //display prompt on the screen output_prompt(); //read input from keyboard read_command( command, parameter1, parameter2, parameter3 ); if (fork() != 0) { //executing in parent code after fork //wait for child to exit waitpid( -1, &status, 0 ); } else { //executing in child code after fork //execute command execlp( command, command, parameter1, parameter2, parameter3, NULL ); return 1; //should never get here (if all goes well) } }

include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
