Does Bash have a way to access arrays similar to Zsh, something like
$ foo=(dog cat mouse)
$ echo $foo[1]
cat
instead of
$ echo ${foo[1]}
perhaps using some shopt setting?
|
|
No. If you want a shell with a lot of options that let you tune the syntax, use zsh. Bash is conservative and does not tend to implement features that would break existing POSIX or ksh scripts. Bash and ksh maintain compatibility with historical shells where |
|||||
|