Question

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?

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top