1
我以为我知道这个(或至少如何谷歌为它)!如何使用grep匹配双引号
但我无法弄清楚在文本文件中搜索模式时如何使用grep匹配双引号。我试图用反斜杠来避免双引号符号,但它似乎不起作用。
>cat trial.txt
"Bill" is here and "Ben" is there
> grep -iE "and \"ben\" is" trial.txt
Unmatched ".
我该如何得到这个工作?
它适用于我的机器 – CMPS
有趣的是,你的代码适用于mingw bash 4.3.42和grep 2.2。你使用什么版本? –
见http://stackoverflow.com/questions/11995353/escape-double-quote-in-grep –