Question: Operating systems Question: Looking at the code below and the output, is the work for the first part/1. of the assignment, correct? How would I

Operating systems

Question: Looking at the code below and the output, is the work for the first part/1. of the assignment, correct? How would I implement part 2 or multiple pipes with I/O redirection, into the code below?

Main.c

Operating systems Question: Looking at the code below and the output, is

Main.c

the work for the first part/1. of the assignment, correct? How would

Instructions

I implement part 2 or multiple pipes with I/O redirection, into the

Output:code below? Main.c Main.c Instructions Output: \#include fcntl.h char gpath[128]; // hold

\#include fcntl.h char gpath[128]; // hold token strings char name [64];// token string pointers int n;// number of token strings char dpath[128]; // hold dir strings in PATH char * dir [64];// dir string pointers int ndir; // number of dirs int tokenize(char "pathname) \{ char s; strcpy(gpath, pathname); // copy into global gpath[] s = strtok ( gpath, " "); n=; while(s) \{ name [n+]t s; // token string pointers s=strtok(," " ); \} name [n]=0;/ame[n]= NULL pointer \} int main(int argc, char "argv[ ], char "env[ ]) \{ int i; int pid, status; char "cmd; char line [128]; // YOU DO: Write code to print argc, argv and env printf(" argc=%d ,argc); 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!