Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!cos!hqda-ai!jay From: jay@hqda-ai.UUCP (Jay Heiser) Newsgroups: comp.unix.questions Subject: Re: Bourne Shell: Variable defined? Keywords: Bourne shell, elementary question Message-ID: <25130@hqda-ai.UUCP> Date: 27 Mar 89 20:51:01 GMT References: <1819@umbc3.UMBC.EDU> Reply-To: jay@hqda-ai.ARPA (Jay Heiser) Organization: CBSI@Washington, D.C. Lines: 8 Take a look at 'test' (type 'man test' for info). [ -z "$foo" ] is true if the length of $foo is zero [ -n "$foo" ] is true if the length of $foo is non-zero I've found this to be more reliable than [ $foo ] or X"$foo" = X Jay G. Heiser