title: How to evaluate variable within `sed` command?
body: <p>I have a variable called "num", that holds a number.  I want to use it in "sed" like so:</p>
  
  <pre><code>sed '1,$(num)d' file.txt
  </code></pre>
  
  <p>also tried:</p>
  
  <pre><code>sed '1,($num)d' file.txt
  </code></pre>
  
  <p>...so that I can delete lines from 1 until the line <code>num</code>.  </p>
  
  <p>It gives me an error like this:</p>
  
  <pre><code>sed: -e expression #1, char 4: unknown command: `('
  </code></pre>
  
  <p>What is the correct way to do this?  thank.</p>