Re: Inconsistent termination of function when 'local' tries to override read-only variable

2020-02-20 Thread Chet Ramey
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, a

Inconsistent termination of function when 'local' tries to override read-only variable

2020-02-19 Thread Arfrever Frehtes Taifersar Arahesis
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. When (indexed or associative) array is read-only, then calling 'local -a' or 'local -A' (without value) for this