I have a situation where I have to use grep to do some string matching, and the option to use the -F
switch is not available. The reason it's not available is grep is being invoked from within a 3rd party library over which I have no control.
The string I'm trying to match is exactly
0 2 * * * /usr/bin/find /data/app-logs/ -mindepth 1 -mtime +14 -a \( -name "*.log*" -o -name "*.out*" -o -name "*.err*" \) -delete
, so a crontab entry. The backslashes above are required.
Grep version being used is:
grep (GNU grep) 2.5.1
I've tried escaping all of the [*\.]
characters, as I believe that's all that needs escaping with regular grep, but to no avail.
Would appreciate any help here. I'm sure it's something small I'm missing.