bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: env variables dropped by bash-2.05


From: Al Elgert
Subject: Re: env variables dropped by bash-2.05
Date: Wed, 16 Jan 2002 10:40:07 +0100
User-agent: Mutt/1.3.25i

On Tue, Jan 15, 2002 at 10:50:43AM -0500, Paul Jarc wrote:
> Al Elgert <elgert@rbg.informatik.tu-darmstadt.de> wrote:
> > On Mon, Jan 14, 2002 at 12:49:50PM -0500, Paul Jarc wrote:
> >> fff() { local i=0 x="${x-10}"; echo "|$i|$x|"; }
> >
> > This does not work, as expected - can I have the Output of your test ?
> 
> $ fff; x=1 fff; echo "$BASH_VERSION"
> |0|10|
> |0|1|
> 2.04.0(1)-release
> 
> Maybe 2.05 is buggy (try upgrading to 2.05a), but *at least* the
> function was not written correctly (assuming I've understood what kind
> of behavior you're trying to get).

I used to override the local variables in a function.
This works up to version 2.04.
Therefore, your Output is correct.
But the bash2.05 drops the variable completely, if you put a variable 
assignment in front of a function call.

I tested the function on bash2.05a, but the behaviour is like bash2.05

        $ fff() { local i=0 x="${x-10}"; echo "|$i|$x|"; }
        $ fff; x=1 fff; echo "$BASH_VERSION"
        |0|10|
        |0||
        2.05a.0(1)-release

greetings
        Alexander

-- 
Alexander Elgert
Public Gruppe
RechnerBetriebsGruppe    TU Darmstadt  (FB 20)   Tel:  +49 06151 16-4333
                                                 Raum: S1/13 11a (alt 25/11a)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]