On 3/27/19 9:06 AM, [email protected] wrote:
> Bash Version: 4.2
> Patch Level: 46
> Release Status: release
>
> Description:
> If I declare a global read-only variable and I try to declare a local
> variable with that name, I can not create
> the local variable.
> I expect that local variables can be declared independently for the
> global variables.
Yes, it's been that way for about as long as bash has had local variables.
The idea is that variables are readonly for a reason, and you shouldn't
just be able to circumvent that with a local variable declaration. It's
similar to the error you get if you try to assign a value to a readonly
variable using an assignment statement that precedes a command.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/