Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re^2: Bourne Shell: Variable defined? Keywords: Bourne shell, elementary question Message-ID: <2202@solo1.cs.vu.nl> Date: 22 Mar 89 18:13:46 GMT References: <1819@umbc3.UMBC.EDU> <9899@smoke.BRL.MIL> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 13 gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: \In article <1819@umbc3.UMBC.EDU> rostamia@umbc3.UMBC.EDU (Rouben Rostamian) writes: \>In C Shell the variable $?foo returns true or false (0 of 1, really) \>depending on whether or not the variable "foo" has been already defined. \ if [ X"$foo" = X ] \ then : # doesn't exist or is an empty string The question was: "Has it been defined?" Ergo, if $foo is an empty string, it IS defined and your test fails. -- Modeless editors and strong typing: |Maarten Litmaath @ VU Amsterdam: both for people with weak memories. |maart@cs.vu.nl, mcvax!botter!maart