procmail
[Top] [All Lists]

Re: "?" with "$"

1999-01-18 01:22:33
* Sat 1999-01-16 David Tamkin <dattier(_at_)Mcs(_dot_)Net> list.procmail
| Sean Straw's suggestion to Jimmy Humphrey included code with these
| conditions:
| 
| | * $? test -s $AUTH_FILE
| | * $? echo $FROM | $FGREP -i -f $AUTH_FILE
| 
| It's been my experience that the "$" modifier is not needed to expand
| variables or command substitutions in exit code ("?"-type) conditions.  It
| might even hurt if the values of the variables or the output of backquoted
| commands includes dollar signs or backticks.
| 
| The "$" modifier is needed for command and variable substitutions in regular
| expressions.

But that's illogical then. The most important thing in programming
languages is that it behave in uniform way. While it may be currently
possible to write "?" lines without the dollar extrapolation, I hope you
make it mandatory in possible new release of procmail.

Procmail is already too full of other exceptions. Eg. I don't understand why
the ?? syntax was chosen as it is:

    #   something is _variable_, but "regexp" is literal

    *  something ?? regexp

    #   REGEXP is variable and needs "$" extrapolation command next to "*",
    #   but funny, something must not be typed "$something"

    *$  something ?? $regexp

It would make much more sense to write $ always when it's question about 
variables:

    *$  $something ?? $regexp

Even worse desicion, that you can move the extrapolation dollar in the line:

    *   something ?? $ $regexp

jari

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