Fix shell script syntax errors

Fixes #6956
Merge pull request #6958 from obrakmann/fix6956

Fix shell script syntax errors