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) } }Hi I am trying to create a runnable shell program and thisis what i have so far, but it isn't working. Can you

include include #include nclude #define MAXLENGTH 1? ///> display command line prompt to screen // read-command() - ssconf ("%s %s %s %s %s., &cmd, &p1, &p2 ' &p3); // printf(.%s, %s, %s, %s", cmd, pl, p2, p3); return 9; voi r* parameteri, char* paramater2, chars parameter3) read command(cha* command, cha char strit1001: 1 an erray of char arrays(strings) each of MAXLENGTH size char arraystr[1e1(MAXLENGTH]; fgets(stri, sizeof stri, stdin) int i, j-, count e; for (i-0; i

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!