Re: Indirect parameter access combined with Assign Default Values

2014-05-07 Thread Dan Douglas
This might have the same fix. I guess Bash only checks for valid variable names during expansion or initial assignment. $ bash -xc 'typeset -n x; x=@ x=(ha ha); typeset -p @' + typeset -n x + x=@ + x=(ha ha) + typeset -p @ declare -a @='([0]="ha" [1]="ha")' Bash eventuall

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-07 Thread Chet Ramey
On 5/7/14, 2:10 AM, Dan Douglas wrote: > On Monday, May 05, 2014 11:18:50 AM Chet Ramey wrote: >> The idea behind the bash-4.3 behavior is that the placeholder local >> variable isn't set, and doesn't really exist. It doesn't shadow a >> global variable with the same name until it gets a value. T

Re: Indirect parameter access combined with Assign Default Values

2014-05-07 Thread Chet Ramey
On 5/7/14, 6:45 AM, Dan Douglas wrote: > This might have the same fix. I guess Bash only checks for valid > variable names during expansion or initial assignment. Thanks, I already fixed this. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita

segfault if nameref set on local variable

2014-05-07 Thread Dan Douglas
Another one to do with namerefs. :-) Looks like it's when the target of the ref is local to the same scope. $ gdb -q -ex 'run -c "function f { typeset x; typeset -n x; x=y; }; f"' ./bash Reading symbols from ./bash...done. Starting program: /home/smorg/doc/programs/bash/bash -c "function f { type

Re: segfault if nameref set on local variable

2014-05-07 Thread Chet Ramey
On 5/7/14, 10:21 AM, Dan Douglas wrote: > Another one to do with namerefs. :-) > > Looks like it's when the target of the ref is local to the same scope. > > $ gdb -q -ex 'run -c "function f { typeset x; typeset -n x; x=y; }; f"' ./bash Thanks for the report. This is an abstraction layer violat

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-07 Thread Dan Douglas
On Wednesday, May 07, 2014 10:04:11 AM Chet Ramey wrote: > On 5/7/14, 2:10 AM, Dan Douglas wrote: > > By "doesn't shadow" you mean that it _does_ hide the global right? > > Localizing > > a variable should cover up globals and variables in parent scopes even if > > they > > aren't given a value.

Re: segfault if nameref set on local variable

2014-05-07 Thread Dan Douglas
On Wednesday, May 07, 2014 10:58:42 AM Chet Ramey wrote: > On 5/7/14, 10:21 AM, Dan Douglas wrote: > > Another one to do with namerefs. :-) > > > > Looks like it's when the target of the ref is local to the same scope. > > > > $ gdb -q -ex 'run -c "function f { typeset x; typeset -n x; x=y; }; f"

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-07 Thread Chet Ramey
On 5/7/14, 11:43 AM, Dan Douglas wrote: > On Wednesday, May 07, 2014 10:04:11 AM Chet Ramey wrote: >> On 5/7/14, 2:10 AM, Dan Douglas wrote: >>> By "doesn't shadow" you mean that it _does_ hide the global right? >>> Localizing >>> a variable should cover up globals and variables in parent scopes e