[CLUE-Tech] spam assassin

Evan Widger PsychoI3oy at linkline.com
Wed Dec 17 17:19:36 MST 2003


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

if not, run it without the wc to see what the actual output you're 
getting with grep is. the latter parts of the grep manpage tell what 
things like \w do.

hope that helps,
Evan




More information about the clue-tech mailing list