daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest May 16th, 2018 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mypipe[2];
  2. //start out with stdin
  3. oldinfd = 0;
  4.  
  5.  
  6. //run the beginning commands. connect in/out of pipes to eachother.
  7. for(int i = 0; i < max; i++){
  8.  
  9.          pipe(mypipe);
  10.  
  11.          processline(commands[i], oldinfd, mypipe[1]);
  12.  
  13.          close(oldinfd);
  14.  
  15.          close(mypipe[1]);
  16.  
  17.          oldinfd = mypipe[0];
  18.  
  19.       }
  20.  
  21.       //run the final command, put output into stdout
  22.       processline(commands[max], oldinfd, 1);
  23.  
  24.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top