[CLUE-Tech] spam assassin
Mike Gant
lister-clue at gantsfort.com
Thu Dec 18 18:41:17 MST 2003
On Wed, Dec 17, 2003 at 05:19:36PM -0700, Evan Widger wrote:
> Mike Staver wrote:
>
> >So, using "identified spam (7.9/5.0) for bart" won't work because of the
> >changing numbers. Is there a way to use an expression of some kind
> >while using grep? I've tried
> >
> >grep -e "identified spam" -e "for bart" /var/log/maillog* | wc -l
> >
> >And it returned a number, I just have no idea if it's correct. It seems
> >very high to me, and I'm sure it's not correct, as you can see from the
> >results below:
> >
> >[root at fimble staver]# grep -e "identified spam" -e "for bart"
> >/var/log/maillog* | wc -l
> > 10736
> >[root at fimble staver]# grep "identified spam" /var/log/maillog* | wc -l
> > 8755
> >
>
> i believe what you're seeing is the total number of lines that contain
> 'for bart' in addition to the total number of lines that contain
> 'identified spam'
>
> unfortunately my grep-foo is not as strong as some, but i believe this
> should work:
>
> grep -e "identified spam \(\w\.\w/\w\.\w\) for bart" /var/log/maillog* |
> wc -1
>
Or how about grep twice,
grep "identified spam" /var/log/maillog* | grep "for bart" | wc -l
searches for lines with "identified spam" then out of those, the lines
that have "for bart" and counts those lines. Is this what you want? Or
do I misunderstand.
Mike
More information about the clue-tech
mailing list