Make shell script executable in Mac os x without entering the terminal

6

3

I have a client that has a mac os x leopard (10.5). I want to be able to ask him to save a shell script that I made in his desktop and execute it, but I can't open the terminal without the client thinking that I'm trying to destroy his computer. :-(

Is there any way I can make the shell executable without entering the terminal and using chmod?

Thanks, Rafael

Rafael

Posted 2010-12-14T15:36:18.777

Reputation: 163

On a side note: …without the client thinking that I'm trying to destroy his computer. Trust issues? – fideli – 2010-12-14T16:10:52.867

1Good grief. Have you pointed out that Apple included Terminal for a reason other than self destruction? – penguirl – 2010-12-14T16:22:03.423

1Thank god the evil commands that can be executed in Terminal can never be performed without opening Terminal, as my answer clearly shows cough. --- @fideli The client might have had a bad experience in the past and, without further knowledge, associated that box with the text in it with pain, costs, and downtime. – Daniel Beck – 2010-12-14T17:00:33.000

The client doesn't understand anything about computers, and he doesn't know me, but as he can't fix his problem normally I have to step up and make something work for him via remote login. Most clients don't complain if I open the terminal, but some do because they have no notion of what I'm doing. – Rafael – 2011-08-15T17:00:52.093

Answers

5

Make an Automator executable or AppleScript that performs the desired command-line actions.


AppleScript:

tell application "Terminal" to do shell script "chmod u+x ~/path"

Terminal will start, but not open a new window.


Automator:

  1. Get ... Finder Items
  2. Run Shell Script with Pass input as arguments and chmod u+x $1

Daniel Beck

Posted 2010-12-14T15:36:18.777

Reputation: 98 421

3

Go the easy route: http://www.sveinbjorn.org/platypus

"Platypus 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."

Hope that helps!

Have a wonderful day.

~ tim

tshubitz

Posted 2010-12-14T15:36:18.777

Reputation: 131

0

You can store it into a tar.gz file and unpack it and run it... =)

bubu

Posted 2010-12-14T15:36:18.777

Reputation: 9 283

0

Try changing the extension on the script to

.command

That should make it a clickable item in Finder.

CaseyIT

Posted 2010-12-14T15:36:18.777

Reputation: 3 213

.tool works as well. – Daniel Beck – 2010-12-14T16:05:30.447

3It changes the default Application to Terminal but stills requires that the shell script has execution permission. It tells me to open Get Info to change it, but there's no option to do it. – Rafael – 2010-12-14T16:06:18.593