title: How to delete a line from a file containing '(' and a variable using bash
body: <p>I have a file named xyz.txt and a varibale delVar=123.<br>
  I need to delete a line from xyz.txt having string:</p>
  
  <p>Some (text($delVar</p>
  
  <p>I tried multiple combinations of sed and awk :</p>
  
  <pre><code>sed -i "/Some\\\(text\\\($delVar/d" xyz.txt
  </code></pre>
  
  <p>Doesn't work.</p>
  
  <pre><code>sed -i '/Some\\(text\\('"$delVar"'/d' xyz.txt
  </code></pre>
  
  <p>Doesn't work either.</p>
  
  <p>When I try to bypass '(' using single \, the error "unmatched ( or (" comes up.</p>
  
  <p>I am using cygwin to run this.</p>
  
  <p>My .sh file:</p>
  
  <pre><code>accountId=$1
  Number=$2
  temp="Example"
  
  grep $temp History.txt &gt; $Number-History.txt
  sed -i '/VALUES (CAST('"$accountId"'/d' $Number-History.txt
  sed -i '/, CAST('"$accountId"' /!d' $Number-History.txt
  sed -i 's/History.txt:/ /' $Number-History.txt
  HistCount=$(wc -l &lt; "$Number-History.txt")
  echo $HistCount
  </code></pre>
  
  <p>My command:</p>
  
  <pre><code>./MyFile.sh 123 ABC000987
  </code></pre>
  
  <p>Here, when I save 123 in accountId and try to set it in my pattern, it matches patters with the number 1234, 1123 etc also</p>