Archive for February, 2007

Make a Unix/bash script executable in Mac OS X

Sunday, February 25th, 2007

For some reason I need make a script executable once every blue moon and I always seem to forget how to do it. Getting old is humiliating.

To make a script executable in Mac OS X, fire up Terminal.app and type this in at the prompt:

chmod +x /file/path/script_name.sh

Press enter and you’re done. The single line above makes a script, named “script_name.sh” located in the directory “/file/path/”, executable. There are probably easier ways to do this, but it works for me.

To execute the script, just type the following into the terminal (assuming you’re in the same directory as the script):

./script_name.sh