Use dash to check shell scripts

We cannot rely on error patterns produced by an arbitrary /bin/sh shell
because there is a wide variety of different Unix systems with different
/bin/sh implementations.

For instance, OS X and some Linux systems use bash as /bin/sh, whereas
Ubuntu and Debian use dash, with greatly different error output formats.

To work around potential issues, always use dash for error checking.
It's available for OS X via homebrew, and on all Linux systems via
package management.