From owner-freebsd-stable Sun Feb 25 10:50:48 2001 Delivered-To: freebsd-stable@freebsd.org Received: from ece.cmu.edu (ECE.CMU.EDU [128.2.236.200]) by hub.freebsd.org (Postfix) with ESMTP id 7636437B491; Sun, 25 Feb 2001 10:50:41 -0800 (PST) (envelope-from allbery@ece.cmu.edu) Received: from pyanfar.ece.cmu.edu (lvygcw@PYANFAR.REM.CMU.EDU [128.2.87.225]) (authenticated) by ece.cmu.edu (8.11.0/8.10.2) with ESMTP id f1PInx102904; Sun, 25 Feb 2001 13:49:59 -0500 (EST) Date: Sun, 25 Feb 2001 13:49:57 -0500 From: "Brandon S. Allbery KF8NH" To: Andreas Klemm Cc: stable@FreeBSD.org, apsfilter-devel@apsfilter.org, =?ISO-8859-1?Q?Michael_Lo=DFin?= 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> X-Mailer: Mulberry/2.0.6 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sunday, February 25, 2001 19:44:42 +0100, Andreas Klemm 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 | > 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