procmail
[Top] [All Lists]

Re: if else

1998-06-02 07:20:29
When Philip Guenther posted,

G> The easiest way to check whether a variable is set (not just whether it
G> contains a non-empty value) is the following condition:

G>       * $ ! ${SPAM+!}

Jari Aalto replied,

A> I have found it more readable to use alternative:

A>     spam        # kill variable

A> See if variable is empty:

A>     * spam ?? ^^^^

A> See if variable is not empty

A>     * ! spam ?? ^^^^

The two are NOT equivalent; there is a big difference.  The original question
that Philip was answering was how to tell whether a variable has been set;
Jari's suggestion checks whether the variable is non-empty, and it treats a
variable that is set but null the same as an unset one.

<Prev in Thread] Current Thread [Next in Thread>
  • Re: if else, jari.aalto
    • Re: if else, David W. Tamkin <=