In bash, looping can be done like so:
for i in **/*.html; do
# do something with i
done
This lets us set get the value of every iteration, but we can't access the index.
Assuming we have an array of items, and we want to get the index of their items as well:
items=(10,20,30)
for i in ${!items[@]}; do
echo "Key: $i"
echo "Value: ${allThreads[$i]}"
done
Array lengths can be calculated like so:
items=(10, 20, 30)
${#items[@]}