Q: How to make a shell script double-clickable
I just installed a program that currently must be launched from a shell script, which, in turn, must be run from Terminal. Is there an easy way to create an alias with an icon that, when double-clicked, runs the script to launch the program? This would be trivial in Windows with a shortcut to a batch file, but I am having the darndest time figuring out how to do it in OS X. Google searches turned up a number of suggestions, all of which appear to be obsolete or accompanied by several follow-up posts to the effect that "I tried this and it didn't work." I tried a few of them, myself (such as changing .sh to .command), and they didn't work for me, either.
Any thoughts?
TIA,
Mark
Any thoughts?
TIA,
Mark
MacBook Pro, Mac OS X (10.6.4)
Posted on Sep 30, 2010 10:21 PM
by BobHarris,Solvedanswer
Mac OS X
Yours:
Change the above to
You have spaces in your path so the dirname is failing.
Also I've replaced the $* with "$@" which as magical properties that preserve quoted call arguments.
Message was edited by: BobHarris
#!/bin/bash
cd "`dirname $0`"/bin && bash datamodeler.sh $*
Change the above to
#!/bin/bash
cd "$(dirname "$0")/bin" && bash datamodeler.sh "$@"
You have spaces in your path so the dirname is failing.
Also I've replaced the $* with "$@" which as magical properties that preserve quoted call arguments.
Message was edited by: BobHarris
Posted on Oct 6, 2010 5:59 AM