[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Empty array referenced by indirection reports unbound variable
From: |
Chet Ramey |
Subject: |
Re: Empty array referenced by indirection reports unbound variable |
Date: |
Sun, 6 Feb 2022 11:31:47 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 |
On 2/6/22 4:23 AM, konsolebox wrote:
On Thu, Dec 30, 2021 at 4:35 PM Chet Ramey <chet.ramey@case.edu> wrote:
Let's try it. Thanks for the report.
It seems to be already fixed in 5.2-alpha (thanks), but I can't see it
mentioned in the changelog. Can you kindly confirm if it really is?
From CHANGES:
"bb. Array references using `@' and `*' that are the value of nameref variables
(declare -n ref='v[@]' ; echo $ref) no longer cause the shell to exit if
set -u is enabled and the array (v) is unset."
From the bash change log:
"subst.c
- parameter_brace_expand: when expanding an indirect variable, extend
the special case for array[@] and array[*] (set -u/no positional
parameters, obeying the baroque quoting rules) to the value of the
indirection. Report and fix from konsolebox <konsolebox@gmail.com>
"
--
``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/