A single quote may not occur between single quotes, even when preceded by a backslash.Hence - my previous suggestion is invalid - there is no "escaping" inside a single-quote.
Here is a shell trick to try:
Replace all perl-directed single quotes with that, and it should work.'"'"'
Extremely ugly, though. Here is how it works:
It starts in single quotes, and which you want a single quote you come out, go into double quotation to quote a single quote, then come out of double quotation, to go back into single quotes again.
Using this trick, your command passes the shell's syntax:
Update: I just noticed that my shell trick is identical to ikegami's (++) last example.perl -pi -e 's#\Q(.*)\$/'"'"',\$lines,\$matches))10.(.*)\$/'"'"',\$li +nes,\$matches))(.*)\$/'"'"',\$lines,\$matches))# #gi' result.txt > re +sult1.txt -- Output (from perl - bash is happy!!!) -- Can't open result.txt: No such file or directory.
Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax
In reply to Re^3: Delete a line from the file
by NetWallah
in thread Delete a line from the file
by ajd335
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |