I wanted to do grep for keywords with double quotes inside. To give a simple example:
echo "member":"time" | grep -e "member\""
That does not match. How can I fix it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The problem is that you aren’t correctly escaping the input string, try:
Alternatively, you can use unescaped double quotes within single quotes:
It’s a matter of preference which you find clearer, although the second approach prevents you from nesting your command within another set of single quotes (e.g.
ssh 'cmd').