Jun 30, 2020 · The shell scripts often have almost the same syntaxes, but they also differ sometimes. For example, array index starts at 1 in Zsh instead of 0 in bash. A script written for Zsh shell won't work the same in bash if it has arrays. To avoid unpleasant surprises, you should tell the interpreter that your shell script is written for bash shell.
Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.