title: How to use variables in sed
body: <p>How to use variables in sed command?</p>
  
  <p>ex: <code>sed '/Jagan/s/Hi/HELLO/' file</code></p>
  
  <p>here i want to replace <code>Hi</code> with a variable</p>
  
  <pre><code>var1=Hi
  sed '/Jagan/s/$var1/HELLO/' file
  </code></pre>