title: Perl one-liner: deleting a line with pattern matching
body: <p>I am trying to delete bunch of lines in a file if they match with a particular pattern  which is variable.</p>
  
  <p>I am trying to delete a line which matches with abc12, abc13, etc.</p>
  
  <p>I tried writing a C-shell script, and this is the code:</p>
  
  <pre><code>    **!/bin/csh
      foreach $x (12 13 14 15 16 17)
      perl -ni -e 'print unless /abc$x/' filename
      end**
  </code></pre>
  
  <p>This doesn't work, but when I use the one-liner without a variable (abc12), it works.</p>
  
  <p>I am not sure if there is something wrong with the pattern matching or if there is something else I am missing.</p>