On Mon, Mar 21, 2022, at 8:50 AM, Alexey via Bug reports for the GNU Bourne
Again SHell wrote:
> I can add one more example, which change array size while it's not
> expected behavior:
> x=("/"); y=("${x[@]%/}"); echo "x size: ${#x[@]}, y size: ${#y[@]}"
This discrepancy seems to have been introduced some ways back.
<larryv> 3# echo "$BASH_VERSION"; x=("/"); y=("${x[@]%/}"); echo "x ${#x[@]}, y
${#y[@]}"
<shbot> 3.2.48(1)-release
<shbot> x 1, y 1
<larryv> 42# echo "$BASH_VERSION"; x=("/"); y=("${x[@]%/}"); echo "x ${#x[@]},
y ${#y[@]}"
<shbot> 4.2.45(1)-release
<shbot> x 1, y 0
--
vq