my spamstats bash script

"Amedee Van Gasse" <[email protected]>
Newsgroups gmane.mail.spam.spambayes.general
Message-ID <[email protected]>
I modified my spamstats shell script, it now also shows the Ham/Spam ratio.

Old version:

#!/bin/sh
#
pkill sb_server.py
(sb_server.py > /dev/null &)
sleep .3
elinks -source http://localhost:8880 | grep am: | html2text | sed 's/ H/\
H/' | sed 's/ S/S/' | column -t
pkill sb_server.py


Output:

Spam:  3215
Ham:   2335



New version:

#!/bin/sh
#
pkill sb_server.py
(sb_server.py > /dev/null &)
sleep .3
SPAM=`elinks -source http://localhost:8880 | grep Spam: | html2text | sed
's/ S/S/' | sed 's/Spam: //' | column -t`
HAM=`elinks -source http://localhost:8880 | grep Ham: | html2text | sed
's/ H/\
H/' | sed 's/Ham: //' | column -t`
pkill sb_server.py
echo "Spam: "$SPAM
echo "Ham: "$HAM
RATIO="scale=3;$HAM/$SPAM"
RATIO=`echo $RATIO | bc -l`
echo "Ham/Spam Ratio: "$RATIO


Output:

Spam: 3215
Ham: 2335
Ham/Spam Ratio: .726


Suggestions are welcome, I'm sure that there are better ways to do this.

-- 
Amedee

_______________________________________________
[email protected]
http://mail.python.org/mailman/listinfo/spambayes
Info/Unsubscribe: http://mail.python.org/mailman/listinfo/spambayes
Check the FAQ before asking: http://spambayes.sf.net/faq.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.