A bash script that runs as /bin/sh might not run as /bin/bash, until you set POSIXLY_CORRECT.
Easiest solution there is to move it to a better shell, usually a Korn variant.