If you specifically target systems that always come with bash
(primarily the typical Linux distros(?)) I see no harm in making use of it if that allows for more maintainable scripts or some other significant advantages to you (provided of course that the shebang properly reflects the bash
dependency).
dash
is aiming to be a lean POSIX compliant shell. Debian and Ubuntu switched to it as a means of getting a lighter shell in the bulk of their startup scripts (leading to faster boot times, etc) as well as ensuring that all their scripts that claim to run with /bin/sh
are not actually riddled with accidental bashisms.
If, on the other hand, portability is important, I think your default /bin/sh
(dash
) seems like a much better starting point as a script which only uses POSIX shell features will probably run on most systems, not only those with bash
present. However, there are of course likely many other factors than just the shell to take into account when dealing with portability.