Question: Iinclude #include #include #include /* needed for getchar, putchar, NULL /* needed for exit) */ /* /* needed needed for fork ( ) for wait()

 Iinclude #include #include #include /* needed for getchar, putchar, NULL /*
needed for exit) */ /* /* needed needed for fork ( )

Iinclude #include #include #include /* needed for getchar, putchar, NULL /* needed for exit) */ /* /* needed needed for fork ( ) for wait() */ */ char command [100]: char "argv[100]: void getcommand (0 ( char ch; int i- 0: putchar do f chgetchar command [ i ]-ch: } while (ch != " "); commandi1]10 void splitargv) int i-0; int j-0; for (;;) { while (command[j]-- . .) j++; if (command [j] .\0.) break; argv]&command [51 while ((command [j] (command [j] *) 0')) - !- { if (command [j]-,\0') command [1]-.\0'; break; argv [1]NULL: void launch ) it (tork00) /child-/ execve( argyI], argv, NULL printf"no such commandln"): exit( EXIT FAILURE ) else t /"parent. wait( NULL int main ) f for () t getcommand 0: splitargv ); launch )

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!