[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: info missing in output of declare -a in 4.4.x
From: |
Dennis Williamson |
Subject: |
Re: info missing in output of declare -a in 4.4.x |
Date: |
Sun, 17 Feb 2019 18:58:09 -0600 |
On Sun, Feb 17, 2019, 6:01 PM L A Walsh <bash@tlinx.org wrote:
>
>
> On 2/17/2019 2:19 PM, Dennis Williamson wrote:
> >
> > So it really is a bug of some sort, not that I use BASH ALIASES
> > for anything. Was going to, but ... and you're right, lots of
> > things aren't showing there.
> >
> >
> >
> >
> > Have you tried starting Bash without any startup files, creating an
> > alias and then checking the array?
> yes. Just now.
> out of 14 vars starting with BASH
> only BASHOPTS is different in the clean startup.
> In a 'normal'[?] startup, there are 3 extra vars starting with BASH_:
>
> BASH_COMPLETION_COMPAT_DIR
> BASH_ENV (I set this, but unset it for this test)
> BASH_REMATCH
>
> then bash (type -p says /bin/bash)
> --noprofile --norc
>
> Version would be same, and the debug related would be blank, but
> hmmm....
> declare -A BASH_CMDS=() (command hashing?)
>
> most of the BASH vars show no value (exception of
> version-related, BASH=/bin/bash & "BASHOPTS", but they
> DO have a value. If I print it in the shell instead
> of using declare -p I see stuff.
>
>
>
>
>
>
>
>
Oh, interesting! In Bash 4 and 5, I just did declare -p with no args and it
showed BASH_ALIASES empty. But with declare -p BASH_ALIASES it shows the
contents (as does the alias command).
Other arrays that show this difference for me:
BASH_CMDS
DIRSTACK
GROUPS
Scalars that exhibit this issue:
BASHPID
BASH_COMMAND
BASH_SUBSHELL
COMP_WORDBREAKS
HISTCMD
LINENO
RANDOM
SECONDS
Re: in bash 4.4.12,want to verify a behavior..., Chet Ramey, 2019/02/17