Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: beta 19 cannot run this script



>>>>> "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