4 ms·
> Why not? If I'm writing scripts for automating configuration on modern macOS, for example, where ZSH is installed by default, why not write ZSH scripts? I gu
by ayushnix 5y ago
> Why not? If I'm writing scripts for automating configuration on modern macOS, for example, where ZSH is installed by default, why not write ZSH scripts?
I guess there are two reasons
- if the script doesn't need arrays, POSIX sh (dash) scripts will be much faster than bash/zsh scripts
- if you do need arrays, bash is vastly more ubiquitous than any other shell on the planet right now (except POSIX sh). It's installed on almost all Linux distributions by default. I'm not gonna use a ZSH script because I'd have to install ZSH, which seems unnecessary. A good example is tomb, which is a ZSH script for encryption on Linux.
If you're sure that your scripts will always run on macOS, use POSIX sh if you don't need arrays and ZSH if you do need them.
- DavideNL 5y agoGood advice, thank you..