Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!vsi1!daver!kesa!greg From: greg@kesa.UUCP (Greg Onufer) Newsgroups: gnu.bash.bug Subject: Re: Possible bug in bash -- basename Message-ID: <180@kesa.UUCP> Date: 23 Nov 89 03:14:18 GMT References: <179@kesa.UUCP> Organization: Kesa Corporation, Santa Clara Lines: 27 From article <179@kesa.UUCP>, by djc@kesa.UUCP (Don Christensen): > > First, I am running bash 1.04 on a 386 clone and Interactive > UNIX sysVr3.2. > Same problem, same machine, but simplified: Sample script: FOO=$1 echo ${1:-EMPTY} <=== Does not work echo ${FOO:-EMPTY} <=== Does work Pass the script one argument and notice the results... If the ${:-} construct is used with $1, it thinks $1 is empty. If the same construct uses $FOO (which is a copy of $1), it works as expected. This is what causes /bin/basename on 386ix to work incorrectly. Did I fix it? I looked in expand_word_internal and decided to leave it to someone who knows what they are doing! Sample Output: cheers% bugscript foo EMPTY foo cheers% Cheers!greg