I am trying to remove a bunch of lines in a file if they match a specific pattern, which is a variable.
I am trying to remove a line that matches abc12, abc13, etc.
I tried writing a C shell script, and this is the code:
**!/bin/csh foreach $x (12 13 14 15 16 17) perl -ni -e 'print unless /abc$x/' filename end**
This does not work, but when I use single-line without a variable (abc12), it works.
I'm not sure if something is wrong with the pattern matching, or if something else is missing for me.
source share