I'm trying to obtain the index of the array I'm iterating within a for loop. I am doing something likearr=( foo bar baz )for i in $arr; do  echo index ${#arr};doneBut that only gives me the number of elements in the array, not the number of the current array. How to do this?
Obtain the index of the array
zsh;array