On Fri, Oct 07, 2022 at 01:28:59AM +1000, Martin D Kealey wrote:
> I write nested functions quite often, usually with a subsequent `unset -f`
> but sometimes (necessarily) without.
>
> Being able to write `local -F funcname { ... }` or `function -L funcname {
> ... }` would be a nice replacement for the former, but the latter is
> usually about different phases of execution, rather than abstractions for
> different data.
You do realize that there are no "nested functions" in bash, right? All
functions exist in a single, global function namespace.
unicorn:~$ bash
unicorn:~$ f() { g() { echo I am g; }; }
unicorn:~$ f
unicorn:~$ type g
g is a function
g ()
{
echo I am g
}
Functions are never "local".