I am kind of new in shell scripting and trying to learn arrays. I declared array value but when I am trying to print that array it is giving me an error(bad substitution). I am pasting the code below, please suggest to me what is wrong here-
➜ ~ cat test.sh
#!/bin/bash
array=['foo','bar','a','b']
echo 1
echo "${array[0]}"
➜ ~ sh test.sh
1
test.sh: 5: Bad substitution
Thanks in advance.