Re: local variable escapes into trap

2009-12-29 Thread Chet Ramey
On 12/29/09 11:55 AM, Akim Demaille wrote: >> I believe that bash is correct. When the `exit' builtin is invoked, and >> the trap is executed, the shell is still executing in the function's >> context. There was no `return', and running exit or a trap does not >> implicitly call it. > > I figur

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, version

Re: local variable escapes into trap

2009-12-29 Thread Chet Ramey
On 12/29/09 4:19 AM, Akim Demaille wrote: > 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) I believe

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.