How to run a bash script from the desktop?
I have a .sh file with a #!/bin/bash
header. I'm able to run it from the terminal, using chmod
and ./
but is there a way to perform these two operations from the desktop (i.e. by clicking on it) ?
Btw, I'm familiar with linux, but not with OS X.
You can add a .command extension to your text script.
Then use chmod 744 to make it executable.
When opened or double-clicked in the Finder it will then run from the Terminal.
Well you can wrap it inside a AppleScript, make a call to shell command (your bash script).
example: do shell script
do shell script "/bin/tcsh my-command-file-path"
save it as an application to your Desktop to run it.
You can put any commands into an AppleScript, and save the script as an applet, or a droplet, or use Automator to create applets and/or droplets. Just use the do shell script
command in the AppleScript.