On 6/3/24 5:54 PM, Will Allan via Bug reports for the GNU Bourne Again SHell wrote:
I'm seeing what appears to be an inconsistency with using `readonly` on 
variables declared in a previous scope.
I think this is a functionality mismatch, and probably a bug in readonly
and export. While readonly and export do not create local variables, they
can operate on them.

Bash does some internal manipulation of arguments to declaration builtins
so they perform the same expansions as standalone assignment statements,
then performs an internal assignment. (The newest version of POSIX
standardizes these `declaration utilities'.)

For scalar variables, this looks in previous contexts. For array variables,
it does not. This is the mismatch. I think it should look in previous
contexts in all cases, and that's the bug.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to