procmail
[Top] [All Lists]

Re: Bill Moseley's ${$MATCH} problem

1999-01-12 11:44:26
"David W. Tamkin" <dattier(_at_)Mcs(_dot_)Net> writes:
Philip Guenther wrote,

| How about:
| 
|      :0
|      * $ $MATCH ?? ^^\/.*
|      ! $MATCH

Bloody heck.  Thank you, Philip.  I'd never have figured that "$" interpre-
tation would work on the variable name to the left of the question marks,
but I tried it and it does.  It's immeasurably better than either of my
suggestions.

In our private exchange about it, Philip added that the above would not
work if there were a newline in the name of the variable in the previous
value of MATCH, but a variable's name shouldn't have an embedded newline
anyway in any shell I know of.  Still, if it should,

 * $ $MATCH ?? ^^\/[.$]+

The newline problem is not with newlines in the variable name but
rather in the value of the indexed variable (the variable whose name is
in MATCH).  David had a thinko on that last example.  It should have
been:
        * $ $MATCH ?? ^^\/(.*$)*


Philip Guenther

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