title: Why do I need to escape parentheses in awk string constant?
body: <p>consider a simple file named <code>test</code> containing the following text:</p>
  
  <pre><code>abc(def)
  </code></pre>
  
  <p>With <code>awk</code>, if I found out that this will work:</p>
  
  <pre><code>awk '$0 ~ "abc\(def\)"' test
  </code></pre>
  
  <p>but it won't work if the parentheses are not properly escaped:</p>
  
  <pre><code>awk '$0 ~ "abc(def)"' test
  </code></pre>
  
  <p>Dropping the right parenthesis, I got this error:</p>
  
  <pre><code>awk: line 1: regular expression compile failed (missing ')')
  abc(def
  </code></pre>
  
  <p>Isn't string quoted by <code>""</code> string constant in awk? Why are <code>()</code> treated as regular expression special character in a string constant?</p>