On 8/28/20 11:28 AM, Greg Wooledge wrote: > > You've got a local variable with the same name as the global variable > that you're attempting to pass by reference. This will not work. > > Namerefs (declare -n) in bash are *not* like uplevel commands in Tcl. > They cause the referenced variable name to be evaluated just like any > other variable would be, starting at the current function scope, then > going up to the caller, and so on.
Namerefs don't change bash's dynamic variable scoping. The two conflict and make namerefs less useful than they might be. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/