title: Why is my sed command failing when using variables?
body: <p>using bash, I'm trying to insert a variable for the date and search a log file for that date, then send the output to a file.  If I hardcode the date like this it works:</p>
  
  <pre><code>sed -n '/Nov 22, 2010/,$p' $file &gt;$log_file
  </code></pre>
  
  <p>but if I do it like this it fails:</p>
  
  <pre><code>date="Nov 22, 2010"
  sed -n '/$date/,$p' $file &gt;$log_file
  </code></pre>
  
  <p>The error I get is: <code>sed: 1: "/Nov 22, 2010/,": expected context address</code>
  Thanks for the help.</p>