On 7/17/22 6:48 PM, Koichi Murase wrote:
2022年7月18日(月) 6:40 Chet Ramey <chet.ra...@case.edu>:
On 7/15/22 7:06 PM, Koichi Murase wrote:
We can shadow local readonly variables. What we cannot are global
readonly variables.

It seems to me a bug.

It's not a bug. Bash-2.04 introduced behavior to disallow local variables
with the same name as readonly variables in a previous scope (whether a
local scope or not). I got requests to relax it, and the result is the
current behavior of restricting it to shadowing readonly variables at the
global scope.

Thank you for your explanation, but "it" (i.e., what seemed a bug to
me) is not the above behavior (allowing to shadow local readonly
variables),

That was certainly not clear from the text you quoted.

1) "set -e" is set.
2) The code is executed from a script file.
3) Shadowing of local readonly variables is attempted in a trap handler.

I'll take a look at this case.


--
``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/

Reply via email to