> On Jan 8, 2021, at 3:50 AM, William Park <opengeome...@yahoo.ca> wrote:
> 
> I don't know if it's a bug.  Manpage says "local" builtin takes all the
> options that "declare" takes.  But, "local -p var" doesn't print
> anything, where as "declare -p var" does.
> 
> f1()
> {
>    local a=123
>    local -p a
> }
> 
> f2()
> {
>    local a=123
>    declare -p a
> }
> 
> f1    # prints nothing
> f2    # prints $a

Please specify your version of bash when posting to these lists.
According to the NEWS file, bash 5.1 behaves as you expect:

    y. `local' now honors the `-p' option to display all local
        variables at the current context.

https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS#n79

vq

Reply via email to