title: Find variable pattern match and delete line by sed
body: <p>I have a variable pattern. And I want to match pattern in file and if pattern is matched then line should be deleted.</p>
  
  <p>I tried with: </p>
  
  <pre><code>sed '/$pattern/d' file.txt
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>Please give me guidence for the same.</p>
  
  <p>Thanks.</p>