procmail
[Top] [All Lists]

Re: Counting lines

2000-02-28 16:13:49
On Sat, Feb 26, 2000 at 04:40:38AM +0200, Liviu Daia wrote:
However, they both expect a message produced by

      mail daia </dev/null

to have a "Lines: 0", and one sent with

      echo | mail daia

to have a "Lines: 1", while the recipe above produces "Lines: 1" and
"Lines: 2" respectively.  If Procmail is counting the header separator,
this didn't use to happen before, as David pointed out.

I read this and began experimenting. Using the above two commands, and the
followin recipe, I got what you got: /dev/null produced "Lines: 1", while echo
produced "Lines: 2", and delivered to my inbox.


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

However, with this recipe:

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

        :0
        /home/andrew/testing
}

Both commands produced "Lines: 0" and delivered to my testing box.
I'm at a loss to explain why they should produce different output. 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?" :)

-- 
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>