title: Another Linux command output (Piped) as input to my C program
body: <p>I'm now working on a small C program in Linux. Let me explain you what I want to do with a sample Linux command below</p>
  
  <pre><code>ls | grep hello
  </code></pre>
  
  <p>The above command is executed in the below passion (Let me know if I've got this wrong)</p>
  
  <ol>
  <li>ls command will be executed first</li>
  <li>Output will be given to grep command which will again generate output by matching "hello"</li>
  </ol>
  
  <p>Now I would like to write a C program which takes the piped output of one command as input. Means, In the similar passion of how "grep" program was able to get the input from ls command (in my example above).</p>
  
  <p>Similar question has been asked by another user <a href="https://stackoverflow.com/questions/12032323/piping-the-output-of-one-command-as-input-to-another-command">here</a>, but for some reason this thread has been marked as "Not a valid question"</p>
  
  <p>I initially thought we can get this as a command line argument to C program. But this is not the case.</p>