I have a very simple .sh file, it contains some delete command to delete some files.
I create this file on Window then upload to Linux server to run.
I've already change Execute mode for this file but can not run it.
This is the important reason & an important experience :)
Because my file is created on window, so it will be saved with window format --> You have to convert it to Linux format if you want to run it.
- Open your file in Linux server: vi yourfile.sh
- Run this command to convert :set fileformat=unix