Unexpected output when accessing array element
a=('1' '2') && echo "${a[0]}"
would be better like this.
In your version you only created a one element array which contains the value "1,2".
a=('1' '2') && echo "${a[0]}"
would be better like this.
In your version you only created a one element array which contains the value "1,2".