Some FAQs: 1. No parameters are needed. The $1 and $2 variables are field variables for awk. 2. This script is more of a "typing saver" rather than a piece of code. Hence, 3. The path to your spam-or-ham file is hardcoded. I have one script for ham and one for spam. Also, 4. I am too lazy to figure out the exact escape sequence to try to plug in a paramater into the awk lines. Any help is appreciated.
Here's the latest version, updated within minutes after my first email. It outputs the list sorted by descending score hits. Change the path for your ham/spam file and it should output the reults. (Pipe to more or output to file, of course. :) If you still want the comma delimited format simply change the space after the last backtick to a comma from ` " $2 } to `," $2 } #!/bin/sh DEFFILES="/etc/mail/spamassassin/local.cf /usr/local/share/spamassassin/*cf" GREPSTR="describe" cat $DEFFILES | egrep ^$GREPSTR \ | awk '{ print "echo `fgrep " $2 " /spam/or/ham/file | wc -l` " $2 } ' \ | sort | uniq | tail +2 | sh | sort -rn >I think this is exactly what I've been looking for! I want to make sure I'm >reading this correct. I'll have to change '/ham/or/spam/file' to my traps. >So I have to run this once for each, correct? > >I don't call this with any parameters, right? The $2 thru me for a loop >here. I'm pretty sure that is the piped data. Just want to make sure. > >This will be so cool if this works!!!!! > >> -----Original Message----- >> From: Regis Wilson [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, September 10, 2003 2:23 PM >> To: [EMAIL PROTECTED] >> Subject: [SAtalk] Rule frequencies >> >> >> I wrote a quick and dirty hack script to count the number of >> rules that match >> in a Spam or Ham file. There are probably better reporting >> tools. There are ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk