On 2/19/20 2:36 PM, Arfrever Frehtes Taifersar Arahesis wrote: > When scalar variable is read-only, then calling 'local' for this > variable (regardless of presence of value in assignment) is non-fatal > and subsequent commands in function are executed.
Correct. This is an implementation choice, and a controversial one, and one that's been in place for about as long as bash has had local variables. Bash creates the local variable with the inherited value, but doesn't allow it to be changed. The rationale is that variables are readonly for a reason, and you shouldn't be able to override readonly variables just by calling a function. The local variable is created, so it's not a variable assignment error. There are advocates on both sides of this issue. Here's the last time the issue came up: https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00150.html It's come up multiple times over the years. -- ``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/