Avoid using GNUisms and BASHisms

This should be a portable project and should run without relying on bash.

/bin/bash is always wrong
/usr/bin/env bash is sometimes correct
/bin/sh is always correct