Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1273 Fix array indexing and length handling for sdk ls
Cf. https://sdkman.slack.com/archives/CJTNQA94M/p1706573532033689?thread_ts=1706516271.626039&cid=CJTNQA94M - Array indexing is wrong, it starts at 1 (not 0) and ends at the highest index, not at array length -1. You have both in C or Java, but shell is different. - Executed in bash the `${#versions}` is - for whatever reason - restricted to four bits. So the maximum value is 15. If the versions array is > 15, you have to use `${#versions[@]}` instead (cf. https://linuxhandbook.com/array-length-bash/).
- Loading branch information