Remove bash specific calls

Make sure that every call in a shell script is supported by /bin/sh and not a bashism, like $()

Closes #4314