Follow

Silly me, assuming that because in bash (as of 5.0.3)

IFS=''
ARR=("one" "two")
for value in ${ARR[*]}
do
echo $value
done

acts as you'd expect,

IFS=''
ARR=("one" "two")
for index in ${!ARR[*]}
do
echo ${ARR[index]}
done

would also work as you'd expect.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!