Re:Use zsh as the default shell on your Mac
by tannhaeuser on Tuesday June 04, 2019 @03:27AM
(#20092706)
I'd recommend to always use just POSIX shell syntax, or at least be aware when you're using bashisms. Bash additions don't buy you much, yet make your script unportable. And using bashisms will get you actually in trouble in practice, since Debian uses dash as default shell, and now Mac OS is using zsh. Considering that shell syntax development has practically ended in 1993, relying on bashisms just isn't worth it.
[ Parent
| on HN ]
Re:Use zsh as the default shell on your Mac
by Sean1708 on Tuesday June 04, 2019 @10:10AM
(#20095182)
To be honest I feel like this is throwing the baby out with the bathwater somewhat. If you're writing a script for a system without bash you'll almost certainly know it, so you might as well just put bash in your shebang. I spent a couple of years using #!/bin/sh and avoiding bashisms, but it was literally never useful so I just went back to using #!/usr/bin/env bash.
Of course it goes without saying that you shouldn't use #!/bin/sh then use bash...