Since everybody chains grep, I'd like to post another one which is more efficient,
awk '/pattern-1/ && ! /patter-2/' maillog This is more efficient when there are more patterns involved. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Shane Sent: Monday, August 08, 2005 12:17 PM To: [email protected] Subject: [clug-talk] Regexp curiousity Hi all, I'm wondering if you could grep a file looking for one quantity but not another. For example, I want to parse my mail log for mails which aren't from my domain and sent. I know that I can: cat maillog | grep -v "randomwords.ca" and I can also: cat maillog | grep "Sent" Is there a way that I could: cat maillog | grep "Sent" AND NOT "randomwords.ca" Any regexp gurus out there? TIA Shane _______________________________________________ clug-talk mailing list [email protected] http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these lines when replying _______________________________________________ clug-talk mailing list [email protected] http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these lines when replying

