I'm looking to switch from bash to zsh but concerned about compatibility of bash scripts.
Are all bash scripts/functions compatible with zsh? Therefore, if that is true is zsh just an enhancement to bash?
|
|
If your scripts start with the line I've found the syntax of zsh really close to the one of bash, and I did not pay attention if there was really some incompatibilities. I switched 6 yeras ago from bash to zsh seemlessly. |
|||
|
Zsh can run most Bourne, POSIX or ksh88 scripts if you put it in the right emulation mode ( The shell you use interactively is irrelevant for any script you have. The shell that runs the scripts is the one indicated in the first line, the shebang line. For example, if the script starts with If you've customized bash, you won't be able just rename your |
|||
|
|
|
But sometimes, there is incompability and may cause danger(This made me confused last night). So just ensure you have "#!/usr/bin/env bash" at the first line. This passage will help a lot. http://slopjong.de/2012/07/02/compatibility-between-zsh-and-bash/ |
|||||
|