You have bashisms in your script and /bin/sh might not always be bash. In that case the script would fail (for example on Ubuntu).