RE: Less and regular expressions
> I'm trying to make a regular search expression that will look for the
word
> "greylist" and the word "*.aol.com" in the same line of the syslog.
Do a Google search for "sed one liners"; I use that /ALL/ the time cause
I never remember all of the cool things sed can do. Anyway, specifically
there is a part that states:
# grep for AAA and BBB and CCC (in any order)
sed '/AAA/!d; /BBB/!d; /CCC/!d'
# grep for AAA and BBB and CCC (in that order)
sed '/AAA.*BBB.*CCC/!d'
So for you, I would suggest:
sed '/greylist/!d; /.aol.com/!d;' /path/to/syslog
Have fun!
~Stack~
Reply to: