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 Chet Ramey
On 10/14/13 9:51 AM, Akim Demaille wrote: > 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,

Re: Local envvar remaining after function call

2013-10-15 Thread Eric Blake
On 10/14/2013 07:51 AM, Akim Demaille wrote: > 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 mo

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 4.2.45(1)-rel

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 (