From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id EAA05284 for ; Thu, 6 Jun 1996 04:08:46 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA01517; Wed, 5 Jun 1996 14:01:49 -0400 (EDT) Resent-Date: Wed, 5 Jun 1996 14:01:49 -0400 (EDT) Message-Id: <9606051800.AA08332@marathon.cs.ucla.edu> To: zsh-workers@math.gatech.edu, Carlos Carvalho Subject: Re: beta 19 cannot run this script Date: Wed, 05 Jun 1996 11:00:46 -0700 From: Eskandar Ensafi Resent-Message-ID: <"HZYq01.0.dN.DkSjn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1266 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hello, On Wed, 05 Jun 1996 14:31:00 EST, Carlos Carvalho wrote: > I tried this and it doesn't work :-( You didn't do exactly what Bart suggested! You must put double quotes around "$APS_BASEDIR" to force [ -z ... ] to see a null argument. Without double quotes, [ -z ... ] might not see an argument if the variable is empty or undefined! The difference is that when $APS_BASEDIR is empty or undefined, the test [ -z $APS_BASEDIR ] becomes [ -z ], which makes no sense, but written as [ -z "$APS_BASEDIR" ], it becomes [ -z "" ], which makes perfect sense. If you don't want to fuss with quotes, then you can write your script in ksh syntax using [[ ... ]] instead of [ ... ]. This test syntax is fully supported in zsh, but you will lose compatibility with /bin/sh. Simply say [[ -z $APS_BASEDIR ]] -- the advantage of [[ ... ]] is that undefined and empty variables will be treated as null arguments. Later, Eskandar