bug-bash
[Top][All Lists]
Advanced

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

Re: [50 character or so descriptive subject here (for reference)]


From: Paul Jarc
Subject: Re: [50 character or so descriptive subject here (for reference)]
Date: Mon, 14 Jan 2002 12:49:50 -0500
User-agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/20.7 (i386-redhat-linux-gnu)

elgert@rbg.informatik.tu-darmstadt.de (Al Elgert) wrote:
> And now consider this function:
>       bash-2.05$ function fff() { local i=0 x; x=10; echo "|$i|$x|"; }
>       bash-2.05$ fff
>       |0|10|
>       bash-2.05$ x=1 fff
>       |0|10|

This output is correct.  If you want the function to be sensitive to
an environment variable setting, you have to write it that way:
fff() { local i=0 x="${x-10}"; echo "|$i|$x|"; }


paul



reply via email to

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