[PLUG] complex expressions with egrep

Ed Sawicki ed at alcpress.com
Tue May 21 21:28:13 UTC 2002


I have log files that I want to grep to extract only log
entries that meet the following requirement:

string1 and (string2 or string3)

I know how to "or" strings in a regular expression but I
don't know how to handle the and condition besides something
like:

grep "string2|string3" logfile | grep "string1"


Is there a better way?

Ed - 11101101





More information about the PLUG mailing list