
You need to use the chmod tool to indicate to the operating system that the text file is executable (that is, its contents can be run as a shell script).
To make a file executable, enter the following command:
chmod 755 YourScriptName.shAfter making the shell script file executable, you can run it by entering its pathname. For example:
~/Documents/Dev/YourScriptName.shor
cd ~/Documents/Dev/ ./YourScriptName.shFor more information about using chmod, see its man page.