On Wednesday 25 August 2004 5:46 am, Jack L. Stone wrote:
> At 10:31 PM 8.24.2004 -0700, Loren Wilton wrote:
> >> >   #!/bin/sh
> >> >   DEFFILES="/etc/mail/spamassassin/*.cf"
> >> >   GREPSTR="describe"
> >> >
> >> >   cat $DEFFILES | egrep ^$GREPSTR  \
> >> >
> >> >      | awk '{ print "echo `fgrep " $2 " /path/to/spamboxes.* \
> >> >      | wc -l` " $2 } ' | sort | uniq | tail +2 | sh | sort -rn
> >>
> >> $ ./spam-check
> >> ./spam-check: line 2: : command not found
> >> ./spam-check: line 3: : command not found
> >> ./spam-check: line 5: : command not found

I just got back to working on these problems, and a fresh mind seems to have 
solved 90% of my problems. They were all due to the leading spaces in each 
line, remove them, and the script runs well with one caveat:

grep:  : No such file or directory

I can only figure that is erroring in 2 places, at /etc/mail/spamassassin/*.cf 
which has 8 *.cf files in it. Or when looking for my spambox, which is 
located at /home/robbo/.Mail/SpamPile/cur/.

The file as it is now running, or not, is:

#! /bin/bash
DEFFILES="/etc/mail/spamassassin/*.cf"
GREPSTR="describe"
cat $DEFFILES | egrep ^$GREPSTR  \
    | awk '{ print "echo `fgrep " $2 "/home/robbo/.Mail/SpamPile/cur/ \
    | wc -l` " $2 } ' | sort | uniq | tail +2 | sh | sort -rn
#EOF

A little more help if you please?

-- 

Linux Desktop user since 2000,
Home networker since shortly after.

Linux User #183693
http://counter.li.org/

Reply via email to