From: fleet(_at_)teachout(_dot_)org
I'd like to be shown a "procmail" way to maintain my
counters. Shelling out to update the counter for every
recipe that gets activated does eat up resources.
I'm out of town (on vacation) and not able to see the list
mail right now, so I don't know how this was answered by
others, if already. But here are a couple of ways for you.
Note that I can't log on as I'm writing this in order to test
any of this.
First, you could simply add a dot to a var for each hit, then
count them at the end:
:0
* condition
{ COUNT = $COUNT. }
After you've done that a bunch of times, at the end, do:
:0
* 1^1 COUNT ?? .
{ TOTCOUNT = $= }
Another way is to do math all the way through with scoring:
:0
* $ $=^0
* 1^0 one condition
{ }
:0
* $ $=^0
* 1^0 another condition
{ }
I believe, but I can't check right now the correctness of that belief,
that the totals ($=) will only accrete for recipes that "succeed."
If that is wrong, then you can of course still set subtotal manually:
:0
* ${SUBTOT:-0}^0
* 1^0 some condition
{ SUBTOT = $= }
Rinse, wash, repeat.
Dallman (from somewhere near the Danish border)
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail