Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 1996 09:46:00 -0400
From:      Garrett Wollman <wollman@lcs.mit.edu>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch), freebsd-current@FreeBSD.org (FreeBSD-current users), bde@zeta.org.au (Bruce Evans)
Subject:   Re: Anyone mind if I remove the following braindamage from test(1)? 
Message-ID:  <9609021346.AA12940@halloran-eldar.lcs.mit.edu>
In-Reply-To: <2920.841647977@time.cdrom.com>
References:  <199609020631.IAA22016@uriah.heep.sax.de> <2920.841647977@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 02 Sep 1996 00:06:17 -0700, "Jordan K. Hubbard" <jkh@time.cdrom.com> said:

> I'd expect that to hold true only if the argument was not a flag
> argument which required a parameter, then I'd expect it to puke.  This
> would also help to quickly find instances where you'd undefined a
> necessary variable in the source tree, instead of giving a cryptic
> error message like:  ``usage: rm [-f | -i] [-dPRr] file ...''

Use:

	[ -d "$foo" ]

instead of

	[ -d $foo ]

.  This will ensure that two arguments get passed to the `-d'
primitive, even if $foo is not defined.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, ANA, or NSA|                     - Susan Aglukark and Chad Irschick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9609021346.AA12940>