URI: 
       tisspam - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tisspam (535B)
       ---
            1 #!/usr/local/plan9/bin/rc
            2 
            3 rfork en
            4 
            5 if (~ $#* 0)
            6         echo usage: isspam mesg && exit 'usage'
            7 
            8 TMP=/tmp/isspam.$USER.$pid
            9 {
           10         echo '# hash table'
           11         msgcat $1|sed '/^$/,$ s/^From / From /'|upas/msgtok|
           12                 grep -v '^....................(.*)        '|
           13                         sed 's/$/        1/'
           14 } >$TMP.tok
           15 
           16 x=`{upas/bayes -k $HOME/mail/_prof.mbox $HOME/mail/_prof.spam ~ $TMP.tok}
           17 where=$x(1)
           18 prob=$x(2)
           19 echo $where $prob
           20 *=($x)
           21 shift 2
           22 while(! ~$#* 0){
           23         echo ' ' $1 $2
           24         shift 2
           25 }
           26 
           27 rm -f $TMP.tok
           28 if (~ $where *spam*){
           29         echo spam
           30         exit ''
           31 } 
           32 if not {
           33         echo ok
           34         exit 'is ok'
           35 }