Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: Re^4: Bourne Shell: Variable defined? Message-ID: <16536@mimsy.UUCP> Date: 26 Mar 89 04:59:27 GMT References: <1819@umbc3.UMBC.EDU> <9899@smoke.BRL.MIL> <2202@solo1.cs.vu.nl> <2209@solo2.cs.vu.nl> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 13 >I wrote: >> if [ "${vax+X}" ]; then echo is set; else echo not set; fi In article <2209@solo2.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) notes that the ""s are not needed (true) and suggests instead: [ ${foo+bar} ] && echo core || echo dumped Alas, `||' misbehaves in some `sh'es when -e is set, whereas `if' misbehaves in fewer (but not none). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris