help-bash
[Top][All Lists]
Advanced

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

Re: A way to show all variables in a function scope?


From: Emanuele Torre
Subject: Re: A way to show all variables in a function scope?
Date: Fri, 29 Oct 2021 07:10:22 +0200

Yes, you can use `local' without argument to print all the local
variables in a function.

    bash-5.1$ f () {
    > local x y
    > local z=2
    > echo hello
    > echo ---
    > local
    > }
    bash-5.1$ f
    hello
    ---
    declare -- x
    declare -- y
    declare -- z="2"



On 29/10/2021, Budi <budikusasi@gmail.com> wrote:
> Is there way to show all variables in a function scope within which
> the command doing for that is executed, as a 'declare ... ' is too
> large not restricted to such needed variable?
>
>



reply via email to

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