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 EAA05430 for ; Thu, 6 Jun 1996 04:18:48 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA01891; Wed, 5 Jun 1996 14:11:46 -0400 (EDT) Resent-Date: Wed, 5 Jun 1996 14:11:46 -0400 (EDT) Date: Wed, 5 Jun 1996 14:11:00 -0400 From: (Mike Kazda) Message-Id: <9606051811.AA19891@rumor.fishkill.ibm.com> To: Carlos Carvalho Cc: zsh-workers@math.gatech.edu Subject: Re: beta 19 cannot run this script In-Reply-To: References: <960605090343.ZM5719@candle.brasslantern.com> Resent-Message-ID: <"EvRMl1.0.TT.XtSjn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1267 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >>>>> "Carlos" == Carlos Carvalho writes: >> >> if [ -z "$APS_BASEDIR" ]; then Carlos> I tried this and it doesn't work :-( Carlos> Trying with this small version: #! /bin/sh if [ -z $APS_BASEDIR ]; then APS_BASEDIR=`grep APS_BASEDIR /etc/printcap | cut -d ':' -f 2` export APS_BASEDIR fi You need to double quote variable otherwise the shell will just evaluate it and there is no argument as indicated by the shell. I think that bash is just a quirk that it works. Normally, ksh, regular sh, this will fail, unless you double quote it. #! /bin/sh if [ -z "$APS_BASEDIR" ]; then APS_BASEDIR=`grep APS_BASEDIR /etc/printcap | cut -d ':' -f 2` export APS_BASEDIR fi Mike