On 4/7/25 12:36 PM, Koichi Murase wrote:
So to be clear, you're requesting a behavior change so that expanding
${#a[0]}, ${#a[*]}, and ${#a[@]}, where a is a scalar variable, when
nounset is enabled, does not result in an unbound variable error.
Right. That is the behavior I naively expect.
Thank you for your answer.
2025年4月8日(火) 0:40 Chet Ramey :
> OK, so you're asking for a new feature/behavior change.
Yes.
> don't get me wrong, but it's a little late in the cycle for bash-5.3.
Yeah, that makes sense. I don't mind if the change would be applied in
a later version.
> > I'd be ha
On 4/5/25 5:37 PM, Koichi Murase wrote:
With nounset, ${#a[@]} for a scalar variable fails even though we can
correctly obtain the result (which is consistent with the expansion of
"${a[@]}") without nounset. This is the result with the devel
version:
$ bash -c 'a=1; echo ${#a[@]}'
1
$