Date: Sun, 25 Feb 2001 13:49:57 -0500 From: "Brandon S. Allbery KF8NH" <allbery@ece.cmu.edu> To: Andreas Klemm <andreas@FreeBSD.org> Cc: stable@FreeBSD.org, apsfilter-devel@apsfilter.org, =?ISO-8859-1?Q?Michael_Lo=DFin?= <phallobst@web.de> Subject: Re: Brokenness: : ${TMPDIR:-/tmp} results in empty TMPDIR variable Message-ID: <112240000.983126997@pyanfar.ece.cmu.edu> In-Reply-To: <20010225194442.A15290@titan.klemm.gtn.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, February 25, 2001 19:44:42 +0100, Andreas Klemm <andreas@FreeBSD.org> wrote: +----- | On Sun, Feb 25, 2001 at 01:24:03PM -0500, Brandon S. Allbery KF8NH wrote: | > On Sunday, February 25, 2001 13:43:11 +0100, Andreas Klemm | > <andreas@FreeBSD.ORG> wrote: | > +----- | > | Another -STABLE problem: | > | | > | : ${TMPDIR:-/tmp} | > | | > | The variable stays empty. | > +--->8 | > | > It should; the correct idiom is | > | > : ${TMPDIR:=/tmp} | | I don't understand that, why :- doesn't work.... | | Well the bash manpage for example states: | | ${parameter:-word} | Use Default Values. If parameter is unset or null, | the expansion of word is substituted. Otherwise, | the value of parameter is substituted. | | ${parameter:=word} | Assign Default Values. If parameter is unset or | null, the expansion of word is assigned to parame- | ter. The value of parameter is then substituted. | Positional parameters and special parameters may | not be assigned to in this way. +--->8 :- affects only the current expansion; := affects the actual value of the variable. | It seems to work this way on other people machines. +--->8 Are you sure? -/:- and =/:= have behaved this way for as long as I've been working with Bourne-like shells (call it 1982). -- brandon s. allbery [os/2][linux][solaris][japh] allbery@kf8nh.apk.net system administrator [WAY too many hats] allbery@ece.cmu.edu electrical and computer engineering KF8NH carnegie mellon university ["better check the oblivious first" -ke6sls] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?112240000.983126997>