[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash syntax




Erving Blake said:
> I tried your script... wont work for me either because the "-z" is
> checking for a FILE THAT ALREADY EXISTS having zero length.

No, actually, it really only checks the variable.

    osiris:~$ foo="" ; if [ -z "$foo" ]; then echo "foo" ; fi
    foo
    osiris:~$ foo="foo" ; if [ -z "$foo" ]; then echo "foo" ; fi
    osiris:~$ 

BTW, for reference, the opposite of -z is -n.

Steve
-- 
steve@silug.org           | Linux Users of Central Illinois
(618)398-7320             | Meetings the 4th Tuesday of every month
Steven Pritchard          | http://www.luci.org/ for more info

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.