title: Variables not working in sed command
body: <p>How to use a variable instead of <code>3</code> in the command below?</p>
  
  <pre><code>sed -i '3s/$/ newvalue/' filename
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>var=1
  sed -i '$vars/$/ newvalue/' filename
  sed -i "$vars/$/ newvalue/" filename
  </code></pre>