Mavericks Server Admin: Make a file executable
This article has been archived and is no longer updated by Apple.
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 program).
To make a shell script executable, enter the following command:
chmod 755 YourScriptName.sh
After making the shell script executable, you can run it by entering its pathname. For example:
~/Documents/Dev/YourScriptName.sh
or
cd ~/Documents/Dev/ ./YourScriptName.sh
For more information about using chmod, see its man page.
Last Modified: Sep 4, 2015