[Top][All Lists]

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

Re: local/typeset/declare -p - outputs invalid declare -- -

From: Chet Ramey
Subject: Re: local/typeset/declare -p - outputs invalid declare -- -
Date: Wed, 16 Nov 2022 14:05:56 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 11/16/22 12:12 PM, Emanuele Torre wrote:
The 31f4d468b60eb27d768ef56d0a8b4982346465d9 commit on the devel branch,
addressed this issue, but only partially:

     bash-5.1$ ./bash --version |& head -n 1
     GNU bash, version 5.2.9(6)-maint (x86_64-pc-linux-gnu)

     bash-5.1$ ./bash -c 'a () { local -; local -p; declare -p -; typeset -p -; 
local -p - ;}; a'
     local -
     declare -- -
     declare -- -
     local -

`local -p -' no longer prints "declare -- -", but `declare -p -', and
`typeset -p -' still do.

It doesn't matter. `local -' is the only way to save and restore the options; `declare -p -' and `typeset -p -' should have no special meaning.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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