Fix bashisms in shell scripts

Bashisms in scripts may cause problems on systems where the default
shell is not Bash.