Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

Main.c

image text in transcribed

Instructions

image text in transcribed

Output:image text in transcribed

\#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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

What is the orientation toward time?

Answered: 1 week ago

Question

4. How is culture a contested site?

Answered: 1 week ago