Re^4: Bourne Shell: Variable defined?

Chris Torek chris at mimsy.UUCP
Sun Mar 26 14:59:27 AEST 1989


>I wrote:
>>	if [ "${vax+X}" ]; then echo is set; else echo not set; fi

In article <2209 at solo2.cs.vu.nl> maart at 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 at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list