In Ubuntu, the default shell /bin/sh
is a symbolic link to /bin/dash
- bash
and dash
have enough functionality in common that most people never realize the difference, but they are not identical (dash is meant to be lighter).
The Debian Almquist shell (dash) is a Unix shell, much smaller than Bash, but it is still aiming at POSIX-compliance. It requires less disk space, but it is also less feature-rich. - Wikipedia
You should be safe while sticking to POSIX syntax, but if your script is using features that are only available in bash
, be sure to change the shebang from /bin/sh
to /bin/bash
to avoid trouble with systems where /bin/sh
is not bash
.
So my advice is: never assume bash is the default shell, stick to syntax from the POSIX standard if you can or explicitly point to /bin/bash
at the shebang.