Fix shell coding style (cf shellcheck)
MacOS adaptation