Created by: cuonglm
Using $array to get all array elements is the zsh syntax, in bash we need ${array[@]} since when reference array without subscript is equivalent with a subscript 0:
array=(1 2 3)
echo "$array"
echo "${array[0]}"
all gave 1.