Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Parameter expansion
- X-seq: zsh-users 2336
- From: jesse@xxxxxxxxxxxxxxxxxxxxxxxx (Roland Jesse)
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Parameter expansion
- Date: Mon, 17 May 1999 11:39:18 +0200 (METDST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- Reply-to: Roland Jesse <jesse@xxxxxxxxxxxxxxxxxxxxxxxx>
The zsh manual says regarding to parameter expansion:
${+name}
If name is the name of a set parameter `1' is substituted, otherwise `0' is
substituted.
But why do I do get the following than?
% if [ ! ${+BLURB} ]; then
then> echo "BLURB not set"
then> else
else> echo "BLURB set"
else> fi
BLURB set
%
I was expecting the opposite. Curiously:
% export BLURB=foo
% if [ ! ${+BLURB} ]; then
echo "BLURB not set"
else
echo "BLURB set"
fi
BLURB set
%
Maybe the question should be: How do you check whether or not an
environment variable is set?
Comments are appreciated.
Roland
Messages sorted by:
Reverse Date,
Date,
Thread,
Author