[wellylug] Parsing Mail log files
andrej at paradise.net.nz
andrej at paradise.net.nz
Fri Oct 28 14:49:47 NZDT 2005
Quoting Jamie Dobbs <jamie.dobbs at orcon.net.nz>:
> I would also like to be able to get the total bytes/kbytes of the
> messages
> received for the day and although I can see how it should be done
> logically I do not know how to translate this into a command for a
> shell
> script like the above. Logic tells me that we want the last "word" of
> the
> line starting with the word "Folder:" and keep a running total of this.
> Can anyone advise how I can do this?
grep Folder ~/Maildir/log* | awk '{sum+=$NF} END{print sum}'
HIH
> Cheers
>
> Jamie
>
Cheers,
Andrej
More information about the wellylug
mailing list