Re: Local envvar remaining after function call

2013-10-15 Thread Akim Demaille
Hi Eric, Hi Chet, > http://thread.gmane.org/gmane.comp.standards.posix.austin.general/8371/focus=8377 Thanks for all these pointers! (I was not aware that standardization of shell features was so alive today). Sorry about the noise.

Re: Local envvar remaining after function call

2013-10-15 Thread Akim Demaille
Le 14 oct. 2013 à 15:51, Akim Demaille a écrit : > $ bash --version > GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12) > Copyright © 2007 Free Software Foundation, Inc. I observe the same thing with less ancient versions of bash. /tmp % bash --version GNU bash, version

Local envvar remaining after function call

2013-10-15 Thread Akim Demaille
Hi! I have this weird behavior that I do not understand: when running FOO=1 foo I do not expect FOO to remain in the env after foo was invoked, even if foo is a shell function. However it does, _if_ bash is invoked in POSIX mode, something which I couldn't find documented in the model (

Re: local variable escapes into trap

2009-12-29 Thread Akim Demaille
Le 29 déc. 09 à 17:35, Chet Ramey a écrit : On 12/29/09 4:19 AM, Akim Demaille wrote: Hi! Hi Chet! On the following script, the local variable $name of bar() hides the global $name when entering the trap. I have observed that with several versions of Bash, including GNU bash

local variable escapes into trap

2009-12-29 Thread Akim Demaille
Hi! On the following script, the local variable $name of bar() hides the global $name when entering the trap. I have observed that with several versions of Bash, including GNU bash, version 4.0.33(1)-release (i486-pc-linux-gnu) FWIW, Zsh and Dash behave as I expected. % cat /tmp/foo.