help-bash
[Top][All Lists]
Advanced

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

Re: feature request, vars local only to function running, not sub functi


From: Greg Wooledge
Subject: Re: feature request, vars local only to function running, not sub functions running
Date: Wed, 12 May 2021 23:02:33 -0400

On Thu, May 13, 2021 at 04:07:49AM +0200, Alex fxmbsw7 Ratchev wrote:
> ..
> 
> how to explain in other words..
> 
> func1() { declare -L foo=bar ; func2 ; }
> func2() { printf %s "$foo" ; } # <-- should print empty

If you want that, simply declare foo locally in func2.



reply via email to

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