I'm trying to use the Unix Tools give me a count of how many e-mails I get from specific domains. Then I can check that against my blacklist. I'm not very versed in this so bear with me. Using the following (all one line)
egrep "Msg failed WEIGHTHOLD|From:" junk0301.log | grep -A 1 WEIGHTHOLD | grep From | cut -d" " -f5 | cut -d@ -f2 | sort -f | uniq -ic | sort -rfn >From.txt I get a nice count of all domains. (Everything after the @) But I would like to strip it down to just return the last two parts. i.e. Let say I get a return of 100 stderr.domain.com 100 bounce.domain.com 100 yahoo.com What I'm looking for is: 200 domain.com 100 yahoo.com But I cannot figure out how to do this and not break the counting of ones that don't have the extra part. Cut is good a being able to grab certain fields and ranges of fields but not by starting at the end and counting back. Anyone have any ideas? TIA, John Olden Systems Administrator Champaign Park District --- [This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)] --- This E-mail came from the Declude.JunkMail mailing list. To unsubscribe, just send an E-mail to [EMAIL PROTECTED], and type "unsubscribe Declude.JunkMail". The archives can be found at http://www.mail-archive.com.
