On 6/22/23 1:54 PM, Grisha Levit wrote:
Using `export' / `readonly' on a variable that's present in both the temp env and a calling function's local context combines the attributes of all the intervening scopes in the global variable:
Hmmmm. Should it even get to this point? Temporary assignments preceding function calls should go away, even in posix mode. The only thing that could propagate in posix mode should be variable assignments directly preceding `export', but those should propagate back to the calling scope and no further. For instance, if you change the assignment to `v= export v', you get the following output: declare -A v so certainly nothing propagated. I realize it's not backwards-compatible, but propagating attributes from export and readonly for variables that appear as assignments preceding function calls looks like something that shouldn't be there in the first place. What do you think? Chet -- ``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/