3 ms·
> So again, if we write system scripts for Debian and want it to run on Debian without any hassle, it makes sense to write the scripts to conform to POSIX shell
by throw0101d 2y ago
> So again, if we write system scripts for Debian and want it to run on Debian without any hassle, it makes sense to write the scripts to conform to POSIX shell.
Or explicitly use bash in your shebang.
One of the problems with Bash is that it insists on doing bash-y things even when you tell it to act like sh.
People ask why you should write (or at least test) code to be multi-platform (even the basics of running it on BSD or macOS): it's because it forces you to be honest. Things change and initial assumptions may not be the same forever.
* https://wiki.debian.org/Shell https://wiki.debian.org/Shell
* https://archlinux.org/packages/?name=checkbashisms https://archlinux.org/packages/?name=checkbashisms
* https://wiki.ubuntu.com/DashAsBinSh https://wiki.ubuntu.com/DashAsBinSh
- ko1nksm 2y ago> One of the problems with Bash is that it insists on doing bash-y things even when you tell it to act like sh. Its behaviour is a common behaviour of all sh, not just Bash.