On 12/8/18 8:30 PM, Grisha Levit wrote: > There seems to be an issue with the following new bash-5.0 feature: > > A nameref name resolution loop in a function now resolves to a variable by > that name in the global scope. > > [ Note: "warning: x: circular name reference" messages omitted below. ] > > While referencing such a nameref works as described, scalar assignment to it > modifies the variable from the next higher scope rather than the global one:
Yes, that's what it does right now. The resolution change is the only one I made, and I'm still not convinced it's the right thing. The code that does the assignment is unchanged, with a comment that says backwards compatibility. That code can operate on the global instance, ignore the nameref attribute and change the value, or just ignore the variable as if it didn't exist. Right now it does what it did in bash-4.4. (Cue Greg and his "nameref variables are an unworkable botch and should just be ignored.") -- ``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/