procmail
[Top] [All Lists]

Re: Counting score program exit code and negation

1997-02-05 15:42:35
Hi,

On Wed, 5 Feb 1997, Philip Guenther wrote:
Hmm, I knew this looked familiar.  I was the one to propose the above
incorrect solution on the 12th of January, at which time David pointed
out to me that it didn't work, so I came up with the basis for the
following correct solution, which I mailed to him and list, but not
you.  Sorry!  I've revised since then to be more compact, but it should
still be understandable.

No problem, it taught me the basics of weighted scoring, and I've
been learning from there. I know RE's and most other UNIX commands,
which is why it's frustrating that I haven't picked up on procmail's
features very easily. No offense, but it's almost as bad as sendmail 
rules.

Well, scoring isn't mentioned on the main manpages to avoid confusing
new users.  However, at the top of the procmailsc(5) manpage it says:

     [*] w^x condition

If you think in terms of BNF grammers, then you would say:

As a sometime parser writer, as a matter of fact, I do think in BNF. :)

condition_line ::= * condition
condition ::= w^x condition
          | ! condition
          | $ condition
          | var ?? condition
          | ? command
          | regexp
          | > number
          | < number


But if you think in BNF grammers, wouldn't the above seem obvious?

No. First of all, the BNF you just gave isn't in there. Second, if
it was, it is still missing:

condition ::= command

which, combined with

condition ::= ! condition 

(which IS in there), would render the desired syntax:
 
* ! command

to be extant.

Each line is a condition: everything follows from that.

Everything that's implied or given in examples, but not defined? I
know I'm going on, but honestly, it's just not in the man pages.
Is there some other reference I should be looking at?

By the way, "h" is meaningless on a recipe whose action line is to launch
a brace nest.  If you want any or all recipes inside the braces to act only
on the head, they need their own h's: flags are not inherited.

The procmailrc man page says that the "H" flag means to egrep only
the header. Since I didn't want the rule acting on the body, and
I had started with the internal egrep, I had the H flag. The body
might have a bunch of @'s in it that I don't want to count.

'H' != 'h'.  The 'h', 'b', 'f', 'i' and 'r' flags are meaningless on
the recipes that opens a nested block.

'H' flag is the default, so unless you also are using the 'B' flag with
it, it's pointless.

Thanks, that clears up some other questions that I didn't ask yet. :)

Ken.
-------------------------------------------------------------------------
Mail: kmarsh(_at_)charm(_dot_)net             | Edit a binary .INI file, then 
tell
WWW:  http://www.charm.net/~kmarsh | me that UNIX is too complicated.
-------------------------------------------------------------------------