title: Insert Header Row using sed
body: <p>I need to run a bash script via cron to update a file.
  The file is a .DAT (similar to csv) and contains pipe separated values.
  I need to insert a header row at the top.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>#!/bin/bash
  # Grab the file, make a backup and insert the new line
  sed -i.bak 1i"red|blue|green|orange|yellow" thefilename.dat
  
  Exit
  </code></pre>
  
  <p>But how can I save the file as a different file name so that it always takes fileA, edits it and then saves it as fileB </p>