On 3/20/22 5:05 PM, Alexey via Bug reports for the GNU Bourne Again SHell
wrote:
Bash Version: 5.1
Patch Level: 16
Release Status: release
Description:
If use 'Parameter Expansion', for example 'Remove matching suffix
pattern', on array and try to iterate over expansion result with for loop,
may occur that loop body will not be executed at all.
Repeat-By:
Code: x=("/"); for i in "${x[@]%/}"; do echo "i is '$i'"; done
Result: none
Expected result: i is ''
Thanks for the report. This is the same issue as
https://lists.gnu.org/archive/html/bug-bash/2022-03/msg00033.html
It will be fixed in the next release.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/