title: Use a variable's value in a sed command
body: <p>I can't seem to use a variable in a sed command, for example:</p>
  
  <pre><code>sed "24s/.*/"$ct_tname"/" file1.sas &gt; file2.sas
  </code></pre>
  
  <p>I want <code>$ct_tname</code> the variable, not literally <code>$ct_tname</code>, which is what I keep getting.</p>
  
  <p>Anybody know how to get this to work?</p>
  
  <p>The problem is actually more complex and I omitted some information.</p>
  
  <pre><code>ct_fname="%let outputfile="/user/ct_"$1".csv";"
  </code></pre>
  
  <p>Here, <code>$1</code> is the argument passed in at the start of my bash script (sed is being run inside a bash script).</p>
  
  <p>This doesn't run successfully, but it does run if I replace <code>ct_fname</code> with</p>
  
  <pre><code>ct_fname="%let table=ct_$1;"
  </code></pre>
  
  <p>Is there a way to get the first <code>ct_fname</code> to be passed successfully?</p>