shell 匹配单引号

Posted uxiuxi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell 匹配单引号相关的知识,希望对你有一定的参考价值。

https://stackoverflow.com/questions/91110/how-to-match-a-single-quote-in-sed

今天在看一个例子 sed ‘/Larry\‘s‘  Larry。 结果死活匹配不到。查询了google才知道。匹配单引号不能简单用转义符号\   

最简单的是用双引号来输入命令

或者

[email protected]:/home/koyaku# sed -e ‘/Larry‘\‘‘/p‘ Larry
abcd
efgh larry
Larry‘s Address
Larry‘s Address
abcd
efgg

 

好多引号。







以上是关于shell 匹配单引号的主要内容,如果未能解决你的问题,请参考以下文章