bug-bash
[Top][All Lists]
Advanced

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

Re: nameref and referenced variable scope, setting other attributes (was


From: Zachary Santer
Subject: Re: nameref and referenced variable scope, setting other attributes (was "local -g" declaration references local var in enclosing scope)
Date: Thu, 14 Mar 2024 20:57:43 -0400

On Thu, Mar 14, 2024 at 3:43 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> In fact, before 2020, local -p with no name arguments behaved the same as
> local without arguments, which just printed all the local variable names at
> the current scope in the form of assignment statements. That was certainly
> not usable to reproduce the current state.

While we're kind of on the subject, I find it really odd that the
${var@A} parameter expansion will expand to either an assignment
statement or a 'declare' command, depending on whether or not the
variable has an attribute set.

You'd think you'd want a parameter transformation that always expands
to a 'declare' command, and maybe another one that always expands to
an assignment statement.



reply via email to

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