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

2022-11-16 Thread Emanuele Torre
On Wed, Nov 16, 2022 at 02:05:56PM -0500, Chet Ramey wrote: > 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 `declare -p'/`typeset -p' commands and the `local -p' command are different commands.

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

2022-11-16 Thread Chet Ramey
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 ()

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

2022-11-16 Thread Emanuele Torre
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 -;

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

2022-10-31 Thread Alex fxmbsw7 Ratchev
On Mon, Oct 31, 2022, 18:31 Greg Wooledge wrote: > On Mon, Oct 31, 2022 at 06:12:14PM +0100, Alex fxmbsw7 Ratchev wrote: > > hi , sorry.. whats the purpose of local - > > informational question > > a. Since there is no `declare -' equivalent of `local -', make sure to use >`local -' in the

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

2022-10-31 Thread Greg Wooledge
On Mon, Oct 31, 2022 at 06:12:14PM +0100, Alex fxmbsw7 Ratchev wrote: > hi , sorry.. whats the purpose of local - > informational question a. Since there is no `declare -' equivalent of `local -', make sure to use `local -' in the output of `local -p'. - s. The `local' builtin takes a

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

2022-10-31 Thread Alex fxmbsw7 Ratchev
hi , sorry.. whats the purpose of local - informational question On Mon, Oct 31, 2022, 17:45 Emanuele Torre wrote: > Since bash 5.2, local/typeset/declare -p without argument no longer > outputs "declare -- -" when local - is used. > > But local/typeset/declare -p - still outputs "declare

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

2022-10-31 Thread Emanuele Torre
Since bash 5.2, local/typeset/declare -p without argument no longer outputs "declare -- -" when local - is used. But local/typeset/declare -p - still outputs "declare -- -" instead of "local -". bash-5.1$ a () { local -; local -p; declare -p -; typeset -p -; local -p - ;} bash-5.1$