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 11:47:50 -0400

On Thu, Mar 14, 2024 at 11:09 AM Chet Ramey <chet.ramey@case.edu> wrote:
>
> `local' always operates at the current function scope. `local -p' only
> displays local variables that exist at the current function scope.

Oh shoot. I hadn't considered that 'local -p' and 'declare -p' would
do different things.

Kind of funny that 'local -g' seems to work just fine, doing the same
thing as 'declare -g' (at least in bash 4.2), but whatever.

Sorry for the confusion.



reply via email to

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