I want to look for the string “methodname(“, but I am unable to escape the “(“. How can I get
grep methodname( *
or
ack-grep methodname( *
to work?
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.
There’s two things interpreting the
(: the shell, andack-grep.You can use
'',"", or\to escape the(from the shell, e.g.grepuses a basic regular expression language by default, so(isn’t special. (It would be if you usedegreporgrep -Eorgrep -P.)On the other hand,
ack-greptakes Perl regular expressions as input, in which(is also special, so you’ll have to escape that too.