title: Inserting text in a file from a variable
body: <p>I have a file that looks something like this: </p>
  
  <pre><code>ABC
  DEF
  GHI
  </code></pre>
  
  <p>I have a shell variable that looks something like this:</p>
  
  <pre><code>var="MRD"
  </code></pre>
  
  <p>What I want to do, is to make my file look like this:</p>
  
  <pre><code>ABC
  MRD
  DEF
  GHI
  </code></pre>
  
  <p>I was trying to do this:</p>
  
  <pre><code>sed -i -e 's/ABC/&amp;$var/g' text.txt 
  </code></pre>
  
  <p>but it only inserts $var instead of the value. I also tried this: </p>
  
  <pre><code>sed -i -e 's/ABC/&amp;"$var"/g' text.txt 
  </code></pre>
  
  <p>but that didn't work either. Any thoughts? </p>
  
  <p>Thanks!</p>