procmail
[Top] [All Lists]

Re: ackmail question

1997-08-11 11:08:00
I'm not sure about the rest of your question, but...

At 06:55 PM 8/10/97 -0400, Timothy J Luoma wrote:
# note: we need the 'awk' because 'wc' stupidly prints out
# whitespace before reporting the number
NOOFACKS=`fgrep -i $SENDER $ACKFILE | wc -l |awk '{print $1]'`
                                                            ^typo

Well, if you're going to use awk anyway, you might as well
get rid of wc then, like this:

NOOFACKS=`fgrep -i $SENDER $ACKFILE |awk 'BEGIN{x=0}{x++}END{print x}'`

(insert my usual disclaimer about not having tested it)

You may also find that gawk, nawk, or mawk (if available) performs
much better... the native "awk" is often old and the worst of the bunch
(as well as missing many good features).

Cheers,
Stan

<Prev in Thread] Current Thread [Next in Thread>