Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
\#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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started