Uploaded CentOS shell scripts won't execute until opened & saved in WinSCP editor
If I simply upload the script with WinSCP 5.9.5 and set permissions the script will not run in the PuTTY box.
The script will run in the Putty box if i simply open and save the script using the WinSCP editor.
As far as I can tell no ownerships or permissions are altered by the editor open/save.
When this "MyScript.sh" bash script I'm working with fails on CentOS Linux release 7.3.1611 (Core), I get the following error:
-bash: ./MyScript.sh: /bin/bash^M: bad interpreter: No such file or directory
It's odd but not the end of the earth because once you reopen and save using the WinSCP editor the script runs reliably.
Regards,
Aza D. Oberman
The script will run in the Putty box if i simply open and save the script using the WinSCP editor.
As far as I can tell no ownerships or permissions are altered by the editor open/save.
When this "MyScript.sh" bash script I'm working with fails on CentOS Linux release 7.3.1611 (Core), I get the following error:
-bash: ./MyScript.sh: /bin/bash^M: bad interpreter: No such file or directory
It's odd but not the end of the earth because once you reopen and save using the WinSCP editor the script runs reliably.
Regards,
Aza D. Oberman