4 ms·
Not exactly the same issue, but this general category of silliness is why I use Zsh for most of my scripts, instead of Bash or "Posix" Sh, whenever I can get aw
by nerdponx 5y ago
Not exactly the same issue, but this general category of silliness is why I use Zsh for most of my scripts, instead of Bash or "Posix" Sh, whenever I can get away with it. The programmer experience in Zsh is much better than Bash around anything related to parameter expansion, quoting, and arrays, while still more or less using the same idioms and syntax.
In addition, the Zsh equivalent of the Bash "strict mode" is a bit stricter. Here's mine:
emulate zsh
setopt \
err_exit \
pipe_fail \
warn_create_global \
warn_nested_var \
no_unset
https://git.sr.ht/~wintershadows/dotfiles/tree/master/item/lib/zsh/strict-mode.zsh https://git.sr.ht/~wintershadows/dotfiles/tree/master/item/l...