title: Combining echo and cat on Unix
body: <p>Really simple question, how do I combine echo and cat in the shell, I'm trying to write the contents of a file into another file with a prepended string?</p>
  
  <p>If /tmp/file looks like this:</p>
  
  <pre><code>this is a test
  </code></pre>
  
  <p>I want to run this:</p>
  
  <pre><code>echo "PREPENDED STRING"
  cat /tmp/file | sed 's/test/test2/g' &gt; /tmp/result 
  </code></pre>
  
  <p>so that /tmp/result looks like this:</p>
  
  <pre><code>PREPENDED STRINGthis is a test2
  </code></pre>
  
  <p>Thanks.</p>