procmail
[Top] [All Lists]

Re: test variable value

2001-02-21 10:45:31
On 20 Feb, Philip Guenther wrote:
| "Timothy J. Luoma" <tjlists(_at_)bigfoot(_dot_)com> writes:
| >
| >how do I do the equivalent of
| >
| >     if [ "$VARIABLE" = "no"]; then
| >
| >in procmailrc?
| 
|       :0
|       * VARIABLE ?? ^^no^^
|       { whatever... }
| 

And my suggestion to Timothy was:

* VARIABLE ?? ^no$

No matter how many times I read a man page there's something new that
didn't register with me previously. I've changed a half dozen or so
of my recipes to Philip's method above, but am curious. His seems
clearly more appropriate to this usage, or rather ^ and $ seem more
suited to a  line-oriented search area. But is there a difference in
this case, or are they functionally equivalent here?  So far I'm
getting the same results from both and never noticed any problems
before, but maybe that was just dumb luck. Thanks.

-- 
 /"\                                                 Don Hammond
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL,
 / \      AND NEWS TOO

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail