procmail
[Top] [All Lists]

Re: total number of messages with mailstat

1997-05-14 05:27:00
At 02:26 AM 5/14/97 -0400, Burnt Norton wrote:
Has anyone hacked `mailstat' to calculate and display the total number of
messages received by procmail in a given logfile?

goblin$ mailstat -k Mail/procmail.log

 Total  Number Folder
 -----  ------ ------
  2133       1 /home/bnorton/incoming/lists/ufo-l
 17621       7 /home/bnorton/incoming/lists/amanda
 10445       4 /usr/mail/bnorton

This is the default output.  I'm looking for a change that will add the 
values in the "Number" column to give a grand total of messages.

Why hack mailstat when a simple UNIX tool will do?

  mailstat -k Mail/procmail.log | awk '{m+=$1;n+=$2;print}END{printf \
        "%  -----  ------\n%7d%8d GRAND TOTAL\n",m,n}'

or the like (untested).

Cheers,
Stan

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