bug-bash
[Top][All Lists]
Advanced

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

Re: local -[aA] on dangling nameref


From: Chet Ramey
Subject: Re: local -[aA] on dangling nameref
Date: Fri, 24 Oct 2025 15:20:16 -0400
User-agent: Mozilla Thunderbird

On 10/24/25 1:21 PM, Grisha Levit wrote:

Thanks for the report. I get

./x2: line 2: local: x: not found

BTW, this still seems incorrect, shouldn't it print `declare -n x'?

It's a good question. You're right. The `local -n x' command acts on the
variable inherited from the temporary environment, which already has a
value. So the command is something similar to `local x=x ; local -n x',
and the variable should have the local attribute after the `local -n x'
command, so `local -p x' can find it.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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