Avoid bashisms and switch to /bin/sh

Bash may not be installed on some systems by default, like FreeBSD.

Differential Revision: http://reviews.llvm.org/D5654