help-bash
[Top][All Lists]
Advanced

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

Re: Bash-5.2 Release available


From: Corey Hickey
Subject: Re: Bash-5.2 Release available
Date: Mon, 31 Oct 2022 13:04:12 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

On 2022-10-31 08:25, Chet Ramey wrote:
On 10/28/22 9:22 PM, Corey Hickey wrote:
On 2022-09-26 12:33, Chet Ramey wrote:
There are a few incompatible changes between bash-5.1 and bash-5.2. Here-
documents and here-strings use temporary files if the shell compatibility
level is 50 or lower. The `unset' builtin in bash-5.2 treats array
subscripts
`@' and `*' differently than previous versions, and differently depending on
whether the array is indexed or associative. Bash-5.2 attempts to prevent
double-expansion of array subscripts under certain circumstances, especially
arithmetic evaluation, by acting as if the `assoc_expand_once' shell option
were set. Set the compatibility level appropriately to revert to previous
behavior; details are in the file COMPAT.

I think I encountered the array subscript change, and I'm having some trouble.

Thanks for the report. I left the arithmetic evaluation of associative
arrays using `@' and `*' as keys alone for backwards compatibility, but
it needs to move up with the rest of the compatibility level code. Here's
a patch that does that.


Thanks. I tested the patch as applied on top of git a99d905216cc0 and it
works the way I would expect.

$ ./bash -c 'declare -A assoc ; var=@ ; assoc[$var]=1 ; echo "$((1 + 
assoc[$var]))"'
2

-Corey



reply via email to

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