title: Print pipe content to screen
body: <p>I am using the <code>execlp()</code> to execute commands on child process and save into a pipe to be read by parent as such for example</p>
  
  <pre><code>int pipefd[2];
  if (pipe(pipefd)) {
      perror("pipe");
      exit(127);
  }
  if(!fork()){
      close(pipefd[0]);
      dup2(pipefd[1], 1);
      close(pipefd[1]);
      execlp("ls", "ls", NULL);
  } else {
      close(pipefd[1]);
      dup2(pipefd[0], 0);
      close(pipefd[0]);
      execlp("wc", "wc", NULL);
  }
  </code></pre>
  
  <p>In some cases, parent doesn't have to execute anything, but rather just print out content of the pipe on the screen, how can I print pipe on screen (possibly without storing into a variable due to unknown output size).</p>