Perl + one-liner smart Perl command, in place grep to match unusual characters + full match

前端 未结 3 1125
隐瞒了意图╮
隐瞒了意图╮ 2021-01-28 00:14

Subject: one-liner smart Perl command instead of a simple grep (in Bash script)

I have a problem when I use grep to match the unusual characters (I can\'t put the \"\\\"

3条回答
  •  离开以前
    2021-01-28 01:07

    You will have to escape the string somehow. Using \ to escape special characters is required in this case, because passing the string to Perl is really no different than passing it to grep -- both will see the string after the shell processes it.

    Using Perl to do this will simply obfuscate your code.

提交回复
热议问题