procmail
[Top] [All Lists]

Re: Counting lines

2000-02-29 15:09:46
On Tue, Feb 29, 2000 at 08:28:01AM +0200, Liviu Daia wrote:
However, with this recipe:

:0 B
*  1^1  ^.*$
{
        :0f
        |/usr/bin/formail -A "Lines: $="

        :0
        /home/andrew/testing
}

    The score is re-evaluated in the inner recipes.  Since you have no
rules that affect the score in the inner recipes you'll always get 0, no
matter what message you feed to Procmail.

So properly this should be more like:

:0B
* 1^1 ^.*$
{
LINES = $=

    :0f
    |/usr/bin/formail -A "Lines: $LINES"

    :0
    /home/andrew/testing
}


I also noticed that if I tried
|/usr/bin/formail -A "Lines: $=" >> /home/andrew/mail/testing

I got "Lines: $=" (a literal "$=") header, instead of a count of the
number of lines. This is why I began experimenting with the latter
recipe above.  Thoughts? Explanations? "Alms for a poor wretched
procmail beginner?" :)

    I don't know, I suppose this one is a bug.  Philip?

Someone was kind enough to explain this one to me off-list.
While I understand the explanation about shellmetas causing it to pass things
to the shell for expansion, rather than expanding internally, and >> is a
shell meta, I'm still trying to grock their "workaround". Meanwhile, testing
shows the reciple/s above to function as expected.

And with that I'm going to unsubscribe this account and re-subscribe from
home, as I expect my place of employment to change within the next few days.


-- 
Andrew Edelstein                email: andrew(_at_)infonent(_dot_)com
Core Services Division          voice: 408-278-4430
Infonent.com, Inc.
San Jose, CA

All opinions or statements are my own and are not official statments of either
Comms People, Inc. or Infonent.com, Inc./ Ideaflood, Inc.

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