if you cannot run a script called yourScript.sh run the following command in terminal sed -i -e 's/ $//' yourScript.sh Then your script should run
dos2unix FILENAME
sed -i -e 's/ $//' create_mgw_3shelf_6xIPNI1P.sh