Why not just:
formail -s echo | wc -l
Steve
Jim Osborn wrote:
I need to know how many individual mails are in an mbox mail folder.
I don't know of any way to get the count directly from formail or
procmail, so it's on to formail -s <something> <mbox-to-count.
My question is: what's the most efficient <something>?
My current favorite is:
cat /dev/null >tempfile
formail -s echo blah >>tempfile <mbox-to-count
COUNT="`wc -l <tempfile`"
rm -f tempfile
This seems cleaner than saving a count in a file, reading it,
incrementing it, and resaving it. But I suspect better minds than
mine might have a simpler solution.
I'm using procmail 3.22.
TIA,
Jim
pgpdOTY7G9t5M.pgp
Description: PGP signature
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail