procmail
[Top] [All Lists]

Re: Variable checking routine...

1997-12-02 12:09:41
Rik Kabel and W. Wesley Groleau have pretty much answered this; I just want
to gather what they've said into one place.

Thanks to all of you -- I thought that had to be wrong, but I'm not a shell
programmer and didn't know how to do this.

First, it is critical whether Catherine means "set" literally (and a null
value is acceptable if the variable is set but null) or she really means
"non-null" (if the variable is set but null, that's unacceptable and the
default value should be used).

I hadn't thought of that, but on considering the issue, I mean "non-null",
since the recipes I use will fail if these variables are not set to
something valid.  So it looks like I want....

VARIABLE=${VARIABLE:-defaultvalue} # if set but null is unacceptable

Now, a follow-up question.  Will this work?

ADMINFOLDER=${ADMINFOLDER:-$DEFAULT}

What I'm trying to do is set a variable's default value to equal that of
another variable -- in this case, set the ADMINFOLDER value to equal the
DEFAULT mailbox.  So does this syntax do the job, or do I need to do this
some other way?

Thank you! :)



--
Catherine Hampton <ariel(_at_)tempest(_dot_)boxmail(_dot_)com>

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