title: pipe between 2 child process do not produce any output
body: <p>So far, i got a function execute_command(command_t) that can execute simple command such as "ls -l", "cat test.txt", etc. However, when I try to implement pipe, it doesn't produce anything. here's the code:</p>
  
  <pre><code>int thePipe[2];
  pid_t child = fork();
  int status1=0;
  pipe(thePipe);
  if(child==(pid_t)-1){
      fprintf(stderr, "error when fork the process\n");
  } else if(child==0){
      close one pipe and make duplicate
      execute command[0]
  } else{
      waitpid(child, &amp;status1, 0);
  }
  int status2=0;
  pid_t child2 = fork();
  pipe(thePipe);
  if(child2==(pid_t)-1){
      fprintf(stderr, "error when fork the process\n");
  } else if(child2==0){
      close one pipe and make duplicate
      execute command[1];
  } else {
      waitpid(child2, &amp;status2, 0);
  }
  </code></pre>
  
  <p>if the input command is:</p>
  
  <pre><code>cat test.txt | grep aaa
  </code></pre>
  
  <p>the command "cat test.txt" will be stored in "c->u.command[0]" and command "grep aaa" will be stored in "c->u.command[1]".</p>
  
  <p>did I do something wrong? thanks</p>