Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!sdcsvax!ucsdhub!jack!man!nusdhub!rwhite From: rwhite@nusdhub.UUCP (Robert C. White Jr.) Newsgroups: comp.unix.wizards Subject: Re: /bin/test and stat(2) Message-ID: <179@nusdhub.UUCP> Date: Tue, 27-Oct-87 14:04:45 EST Article-I.D.: nusdhub.179 Posted: Tue Oct 27 14:04:45 1987 Date-Received: Fri, 30-Oct-87 05:03:57 EST References: <9974@brl-adm.ARPA> Organization: National University, San Diego Lines: 20 Summary: A simple fix: In article <9974@brl-adm.ARPA>, franco@MIKEY.BBN.COM (Frank A. Lonigro) writes: > After reading the many responses to my original invocation of this subject > (many of which got off onto the wrong track), I still think that: > /bin/test -d "$FOO" > should return FALSE if FOO="" The issue above is easily setteled by a little care... > /bin/test -d "$FOO" should become one of the following: /bin/test -d "${FOO:? }" # to terminate shell /bin/test -d "${FOO:=/etc/system}" # to garentee false /bin/test -d "${FOO:-/etc/system}" # same without affecting # the value of FOO If you take care of your variable sustitutions, they will take care of you. Incidently, on our system 'test -d "" ' returns false anyway... Cest le Gare Rob.