Make the shell scripts more portable

https://github.com/contao/core/commit/0b240b94e570e08d56346f2859b16b4b9a3f9044#commitcomment-5984629