title: Using sed to replace text with spaces with a defined variable with slashs
body: <p>I am trying to use sed to replace a line with spaces with a defined variable. </p>
  
  <p>For example,</p>
  
  <p>I want to replace 'a dumb string' with $lan, and lan="~/afile.py</p>
  
  <p>I assumed the line would be </p>
  
  <pre><code>sed "s/a dumb string/$lan/g" file.txt
  </code></pre>
  
  <p>but this leave the 'a dumb string' part blank in the file.txt. </p>
  
  <p>My problem seems simple enough. Any help is much appreciated. </p>