Bashは二重引用符で変数の置換を行います。
これはうまくいくはずです:
perl -p -i -e "s/\n//g" file.html
EDIT Actually, that might act weird with the \n
in there. Another approach is to take advantage of Bash's string concatenation. これはうまくいくはずです:
perl -p -i -e 's/\n//g' file.html
EDIT 2: I just took a closer look at what you're trying to do, and it's kind of dangerous. You're using the greedy form of .*
, which could match a lot more text than you want. Use .*?
instead. I updated the above regexes.