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

Main.c

Instructions

Output:![code below? Main.c Main.c Instructions Output: \#include fcntl.h char gpath[128]; // hold](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e2870c826ea_73966e2870be0b84.jpg)
\#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
Get step-by-step solutions from verified subject matter experts
