title: How can I add a line to a file in a shell script?
body: <p>I want to add a row of headers to an existing CSV file, editing in place. How can I do this?</p>
  
  <pre><code>echo 'one, two, three' &gt; testfile.csv
  </code></pre>
  
  <p>and I want to end up with</p>
  
  <pre><code>column1, column2, column3
  one,     two,     three
  </code></pre>
  
  <p>Changing the initial CSV output is out of my hands.</p>
  
  <p>Any standard command will do. The important thing is the file is edited in place, and the line is inserted at the beginning of the file.</p>