boomshanka
boomshanka

Reputation: 186

Create an app from a bash script that accepts arguments?

As it says ... in OSX can i create an application based off a bash script - that accepts arguments ?

So for example i can run in terminal :

open /path/to/MyBashScriptApp.app myArgument1

This app will run with the argument passed to it?

I know i can rename to .command - but i need it to be an app .

Upvotes: 0

Views: 4763

Answers (3)

yabt
yabt

Reputation: 1

There's also a command line interface to Automator, automator(1), which has an -i & -D switch for user-specified input.

Upvotes: 0

Yuji
Yuji

Reputation: 34185

Use Automator, which can be found in your

/Applications/Utilities/Automator.app 

With it you can easily package a bash script into an app, accepting file names. Look for an action called "Run Shell Script".

Upvotes: 2

dtlussier
dtlussier

Reputation: 3129

If you are using OS X 10.6 then you can do:

% open /path/to/App.app --args arg1 arg2 ... 

Check out this related question from superuser

https://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac

Upvotes: 0

Related Questions