From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2906 invoked from network); 17 May 1999 09:48:34 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 May 1999 09:48:34 -0000 Received: (qmail 17335 invoked by alias); 17 May 1999 09:47:57 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2337 Received: (qmail 17034 invoked from network); 17 May 1999 09:47:52 -0000 Message-Id: <9905170923.AA28440@ibmth.df.unipi.it> To: zsh-users@sunsite.auc.dk Subject: Re: Parameter expansion In-Reply-To: "Roland Jesse"'s message of "Mon, 17 May 1999 11:39:18 DFT." <14143.58310.693584.42423@busch.cs.uni-magdeburg.de> Date: Mon, 17 May 1999 11:23:22 +0200 From: Peter Stephenson Roland Jesse wrote: > 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 > % That's becuase % if [ ! 0 ]; then print no; else print yes; fi yes % if [ ! 1 ]; then print no; else print yes; fi yes It's testing whether the string has length zero, which it doesn't. You need arithmetical evaluation; change the [ to (( and the ] to )) and everything should work. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy