I have a python script that reports how many times an error shows up in catalina.out within a 17 minute time period. Some errors contain more information, displayed in the next three lines beneath the error. Unfortunately the sentence I’m grepping for contains []. I don’t want to do a search using regular expressions. Is there a way to turn off the regular expression function and only do an exact search?
Here is an example of a sentence im searching for:
bob: [2012-08-30 02:58:57.326] ERROR: web.errors.GrailsExceptionResolver Exception occurred when processing request: [GET] /bob/event
Thanks
(assuming you are using the standard grep command)
Sure, you can pass the
-Fflag togrep, like so:Remember to put the search term in quotes, or else bash will interpret the brackets in a special way.