$ myArray=(a b c d)
$ for val in ${myArray[@]} ; do echo - $val ; done
- a
- b
- c
- d
$ for val in ${!myArray[@]} ; do echo - $val ; done
- 0
- 1
- 2
- 3
$ myArray+=(d e)
$ for val in ${myArray[@]} ; do echo - $val ; done
- a
- b
- c
- d
- d
- e
$ for val in ${!myArray[@]} ; do echo - $val ; done
- 0
- 1
- 2
- 3
- 4
- 5