Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: beta 19 cannot run this script
- X-seq: zsh-workers 1267
- From: <kazda@xxxxxxxxxxxx> (Mike Kazda)
- To: Carlos Carvalho <carlos@xxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: beta 19 cannot run this script
- Date: Wed, 5 Jun 1996 14:11:00 -0400
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <m0uRMR2-000031C@xxxxxxxxxxxxxxxxxxxxx>
- References: <m0uRK3H-00001zC@xxxxxxxxxxxxxxxxxxxxx> <carlos@xxxxxxxxxxxxxxxxxxxxx> <960605090343.ZM5719@xxxxxxxxxxxxxxxxxxxxxxx> <m0uRMR2-000031C@xxxxxxxxxxxxxxxxxxxxx>
>>>>> "Carlos" == Carlos Carvalho <carlos@xxxxxxxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author