문제

Also, I want to keep some type of outer quotes so that I can use a large regular expression.

For example, if file 'Test' contains literal: "Josh's Dog"

I do grep '"Josh's Dog"' test

and it doesn't work.

What do I need to escape out of?

도움이 되었습니까?

해결책

Maybe try this:

grep \"Josh\'s\ Dog\" test

Or as noted here Why escaped single quote doesn't work in grep?, try

grep -P '"Josh\047s Dog"' dat
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top