Question
/*-------------------------------------------------------------------- Description: Double pipe program. To pipe the output from the standard output to the standard input of two other processes. Usage: dp : :
/*--------------------------------------------------------------------
Description: Double pipe program. To pipe the output from the standard output to the standard input of two other processes. Usage: dp
-------------------------------------------------------------------------*/ #include
/*--------------------------------------------------------------------
File: dp.c
Description: Main will parse the command line arguments into three arrays of strings one for each command to execv(). --------------------------------------------------------------------*/
int main(int argc, char *argv[]) {
int i,j; /*indexes into arrays */ char *cmd1[10]; /*array for arguments of first command */ char *cmd2[10]; /*array for arguments of second command */ char *cmd3[10]; /*array for arguments of third command */ if(argc == 1) { printf("Usage: dp
/* get the first command */ for(i=1,j=0 ; i /* get the second command */ for(j=0 ; i /* get the third command */ for(j=0 ; i exit(doublePipe(cmd1,cmd2,cmd3)); } /*-------------------------------------------------------------------------- ----------------- You have to implement this function -------------------- -------------------------------------------------------------------------- Function: doublePipe() Description: Starts three processes, one for each of cmd1, cmd2, and cmd3. The parent process will receive the output from cmd1 and copy the output to the other two processes. -------------------------------------------------------------------------*/ int doublePipe(char **cmd1, char **cmd2, char **cmd3) { return 0; }
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