title: (How) can I remove all newlines (\n) using sed?
body: <p>I tried to remove all newlines in a pipe like this:</p>
  
  <pre><code>(echo foo; echo bar) | sed -e :a -e N -e '$!ba' -e 's/\n/ /g' | hexdump -C
  </code></pre>
  
  <p>Which results on debian squeeze in:</p>
  
  <pre><code>00000000  66 6f 6f 20 62 61 72 0a                           |foo bar.|
  00000008
  </code></pre>
  
  <p>Not removing the trailing newline.</p>
  
  <p><code>tr -d '\n'</code> as in <a href="https://stackoverflow.com/questions/3134791/how-do-i-remove-newlines-from-a-text-file/3134827#3134827">How do I remove newlines from a text file?</a> works just fine but isn't sed.</p>