How to run a shell script in OS X by double-clicking

  • First in terminal make the script executable by typing:
    chmod a+x (yourscriptname)

 

  • Then, in Finder, right-click your file and select “Open with” and then “Other…”.

 

  • Here you select the application you want the file to execute into, in this case it would be Terminal.
  • To be able to select terminal you need to switch from “Recommended Applications” to “All Applications”.
    NOTE: The Terminal.app application can be found in the Utilities folder

 

  • If you want this to be the default behaviour from now on, check the “Always Open With” box.
  • After clicking OK you should be able to execute you script by simply double-clicking it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s