In case it isn't perfectly clear,
/bin/sh is the system's default POSIX shell. This can be provided by quite a few different actual shell interpreters,
bash,
ksh,
zsh,
dash,
ash, and probably more. But what they all have in common is that when invoked as "
#!/bin/sh", the script will be interpreted according to POSIX specifications. Some shells like
dash and
ash are in fact very strict posix-only shells and will not understand anything outside of what's defined there.
That's why you should always explicitly set your script's shebang to that of the actual interpreter you're writing for. If you're using
bash, use
#!/bin/bash, and nothing else.
Finally, I recommend not using evo2's suggestion for how to change the default shell. The distribution you're using undoubtedly has other, safer ways to do so. On Debian-based systems, for example, you should use "
dpkg-reconfigure <shellname>". I also recommend
configure-debian, the ncurses front-end for modifying such system parameters.
http://wiki.debian.org/DashAsBinSh
https://wiki.ubuntu.com/DashAsBinSh
Check your distro's documentation for their recommended way to do it.