bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: local -r issue in conjunction with trap


From: Chet Ramey
Subject: Re: local -r issue in conjunction with trap
Date: Mon, 18 Jul 2022 09:27:15 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 7/17/22 6:48 PM, Koichi Murase wrote:
2022年7月18日(月) 6:40 Chet Ramey <chet.ramey@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    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]