Closed mipsou closed 3 years ago
Hi @mipsou. Why is this needed? The current -1
index gets the last element of the array (which is the intended behaviour).
Hi, Thank for your'sfast answer. "-1" gives a get error index in the "arr" array under linux RHEL6 bash 4.1: 2 It work perfectly now. I think a negative index is not permit.
Negative index was introduce with bash 4.2 (released in 2011) See: https://github.com/bminor/bash/blob/36f2c40/CHANGES#L3034-L3035
Ok, Next time I did a PR with a bash version test greater than 4.1 to automatically change the index.
Thanks you
Merged (with a slightly modified commit message). Thanks!
Fix error in arr bad index array