Making an executable bash file run when clicked Making an executable bash file run when clicked bash bash

Making an executable bash file run when clicked


You can add a ".command" extension to the filename -- then double-clicking it will automatically open Terminal and run the script in a new window. Note: this assumes you still want to watch/interact with the script via a Terminal interface; if you want to avoid this as well, wrapping the script with Platypus, AppleScript, or Automator (as Zifei and Ned suggest) would be better options.


What you need is Platypus.

Platypus is a developer tool for the Mac OS X operating system. It can be used to create native, flawlessly integrated Mac OS X applications from interpreted scripts such as shell scripts or Perl and Python programs. This is done by wrapping the script in an application bundle directory structure along with an executable binary that runs the script.


The easiest thing to do is to type: sudo chmod 755 the_file_Name.This will allow you to double click on the file in the finder.