title: Trouble with piping through sed
body: <p>I am having trouble piping through sed. Once I have piped output to sed, I cannot pipe the output of sed elsewhere.</p>
  
  <pre><code>wget -r -nv http://127.0.0.1:3000/test.html
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>2010-03-12 04:41:48 URL:http://127.0.0.1:3000/test.html [99/99] -&gt; "127.0.0.1:3000/test.html" [1]
  2010-03-12 04:41:48 URL:http://127.0.0.1:3000/robots.txt [83/83] -&gt; "127.0.0.1:3000/robots.txt" [1]
  2010-03-12 04:41:48 URL:http://127.0.0.1:3000/shop [22818/22818] -&gt; "127.0.0.1:3000/shop.29" [1]
  </code></pre>
  
  <p>I pipe the output through sed to get a clean list of URLs:</p>
  
  <pre><code>wget -r -nv http://127.0.0.1:3000/test.html 2&gt;&amp;1 | grep --line-buffered -v ERROR | sed 's/^.*URL:\([^ ]*\).*/\1/g'
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>http://127.0.0.1:3000/test.html
  http://127.0.0.1:3000/robots.txt
  http://127.0.0.1:3000/shop
  </code></pre>
  
  <p>I would like to then dump the output to file, so I do this:</p>
  
  <pre><code>wget -r -nv http://127.0.0.1:3000/test.html 2&gt;&amp;1 | grep --line-buffered -v ERROR | sed 's/^.*URL:\([^ ]*\).*/\1/g' &gt; /tmp/DUMP_FILE
  </code></pre>
  
  <p>I interrupt the process after a few seconds and check the file, yet it is empty.</p>
  
  <p>Interesting, the following yields no output (same as above, but piping sed output through cat):</p>
  
  <pre><code>wget -r -nv http://127.0.0.1:3000/test.html 2&gt;&amp;1 | grep --line-buffered -v ERROR | sed 's/^.*URL:\([^ ]*\).*/\1/g' | cat
  </code></pre>
  
  <p>Why can I not pipe the output of sed to another program like cat?</p>