procmail
[Top] [All Lists]

Re: number of preceding messages

1997-10-30 13:50:46
Joseph Wetstein asked,

| I saw someone's autoreplier that gave a running count of the number of 
| messages ahead of the one that was just sent... i.e. "thank you for your
| message. I'll get to it as soon as I can. There are   5  messages ahead of
| you in the queue"
| 
| How do I do that?

If your inbox is a plain folder,

   ALREADY_THERE=`grep -c '^From ' $DEFAULT`

will give the number (or one slightly too high).

If your inbox is a directory, you'll need two processes.  This is one way:

   ALREADY_THERE=`ksh -c 'echo $DEFAULT/!(*.lock) | wc -w'`

<Prev in Thread] Current Thread [Next in Thread>
  • helpo?, Joseph P. Wetstein
    • Re: number of preceding messages, David W. Tamkin <=