Re: Strange behaviour when sourcing files with functions
From:
Al Elgert
Subject:
Re: Strange behaviour when sourcing files with functions
Date:
Thu, 21 Aug 2003 15:22:51 +0200
User-agent:
Mutt/1.5.2i
Henk Csaba schrieb am 08.08.2003 um 09:50:56 (+0200):
> In the following '$' symbolizes the bash prompt and we imitate an interactive
> bash session.
>
> $ echo '. foo ooh ; echo $1' > fooscript
> $ echo : > foo
> $ bash fooscript aah
> aah
> $ echo 'fnc() { :; } ; fnc' > foo
> $ bash fooscript aah
> ooh
>
> I find it very strange that the $1 of a script becomes overwitten by a .
> command. It smells
> like a bug.
>
I was able to reproduce the bug in
GNU bash, version 2.05.0(1)-release (sparc-sun-solaris2.7)
and
GNU bash, version 2.05.8(1)-release (i386-redhat-linux-gnu)
but not in
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
It was a bug.
--
Alexander Elgert
Public Gruppe
RechnerBetriebsGruppe TU Darmstadt (FB 20) Tel: +49 06151 16-4333
Raum: S1/13 11a (alt 25/11a)
FAQ2: http://www.informatik.tu-darmstadt.de/RBG/service/FAQ2/