title: How can I make a linux command wait for the end of input before piping?
body: <p>I find myself often using linux shell commands, such as <code>grep</code>, <code>sed</code> and <code>awk</code>, to format/filter/forward stuff into something more useable.</p>
  
  <p>The "source" data is usually the output of a process, or the <code>cat</code> of a local file.</p>
  
  <p>As I'm becoming more fluent with the commands, I find myself using them more and more. What I used to do before with a notepad++ regex-search&amp;replace, I now know how to do "on the fly" in my shell.</p>
  
  <p>The "issue" I'm now encountering is how to deal with data I've "copied" from another source, which I want to feed into the shell directly via stdin, and the output I only want to see in stdout. The problem I'm encountering is that there is a "criss-cross" of the input and output. For example:</p>
  
  <pre><code>&gt;awk '$1 == "true" {print $2}'
  true Paul
  Paul
  false John        
  true Janice
  Janice
  </code></pre>
  
  <p>The issue is that this is not useable for me. I need the output to come clearly separated from the input. Either it comes afterwards, or I don't want to see stdin at all.</p>
  
  <p>How could we do that? I've found I can use <code>tail</code> to "hold" the input data until it's all been fed:</p>
  
  <pre><code>tail -n 999 | awk '$1 == "true" {print $2}'
  true Paul
  false John
  true Janice
  Paul
  Janice
  </code></pre>
  
  <p>This works, but is a little bit cumbersome.</p>
  
  <p>Are there any built-in commands that basically "hold" the stream until it is over (or rather, don't print anything until all input has been processed)? Or ways to simply suppress seeing stdin? I could also use temp files, but I'd like to have a "clean 1 step no overhead" way of doing it...</p>