Re: [Exim] String expansion depending on existance of variab…

Top Page
Delete this message
Reply to this message
Author: Sven Geggus
Date:  
To: exim-users
Subject: Re: [Exim] String expansion depending on existance of variable?
John Jetmore <jetmore@???> wrote:

> ${if def:variable {foo}{bar}} should do what you're asking.


shure?

From The Spec Chapter 11.6:

--cut--
def:<variable name>

The def condition must be followed by the name of one of the expansion
variables defined in section 11.8. The condition is true if the named
expansion variable does not contain the empty string, for example

${if def:sender_ident {from $sender_ident}}

Note that the variable name is given without a leading $ character. If the
variable does not exist, the expansion fails.
-cut--

The statement does _not_ say:

"If the variable does not exist, the condition is false"

I't OK, when there is no difference between this two statements.

What I actually want to do would be something like this:

${if def:foo {expand something which uses $fo}{bar}}

So the question is if bar is returned in the case, that foo is a nonexistant
variable-name.

Sven

--
Der "normale Bürger" ist nicht an der TU Dresden und schreibt auch
nicht mit mutt. (Ulli Kuhnle in de.comp.os.unix.discussion)

/me is giggls@ircnet, http://sven.gegg.us/ on the Web