help-bash
[Top][All Lists]
Advanced

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

Re: memory management of all_visible_functions return


From: Robert E. Griffith
Subject: Re: memory management of all_visible_functions return
Date: Thu, 21 Apr 2022 10:43:00 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

Thanks for the explanation. Is this seen as a feature of bash or is it a necessity of implementation?

--BobG

On 4/21/22 10:06, Chet Ramey wrote:
On 4/20/22 3:52 PM, Robert E. Griffith wrote:

`Invisible' variables are variables that have been assigned attributes but
not values, so they are technically unset.

So what is the practical consequence of them not being visible?

The variable shows as unset when referenced.

Local variables have their own scoping issues that complicate things on
occasion, but it's easy to see with something like this:

myvar="hello"
foo()
{
   local myvar
   local b=isset

   echo "${myvar-unset}"
   echo "${b-unset}"
}
foo

You'll get

unset
isset

as output because `myvar' is unset.





reply via email to

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