Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know if there's a way I could package compiled command line tools together as part of an automator script or an app.

Let's say, for example, I want to use a command line tool called foo and this relies on jpeglib and a few other libs. Am I able to put them in the same folder and somehow pipe this new $PATH to the foo app?

The reason I want to do this is that a client requires something that I usually use a bash script for. In order for them to do the same thing they'd need to installed XCode (to get the gcc compiler) and install the command line tools (through macports, fink, etc...) and of course that's hassle.

share|improve this question
You've asked a question that sits really close to the edge between AskDifferent where pure applescript is in scope ( but Xcode / gcc / advanced shell scripting like passing path variables in and out of AppleScript might be better fielded on I'll answer here assuming your bash script gets called by Apple Script. – bmike Jul 21 '11 at 16:33

All macs have several shells available (GNU bash 3.2.48 ships with the latest Snow Leopard) including zsh, sh, bash, csh and ksh. You can safely embed one or more shell scripts without fear that other macs won't have the tools to run your program.

The simplest thing to do would be to just embed a functioning shell script in an AppleScript or Automator workflow. Both handle piping arguments or file paths to stdin/stdout so you can interact with the script if desired.

The site Mac OS X Automation has some great tutorials to get you started if this makes sense to solve your issue.

Also, if you are looking for a tool to package your bash script and an automator/applescript document in one nice unit - the package maker application is available for free as part of the iPhone Configuration utility. It's more work, but will make any mac user more comfortable installing your tool.

share|improve this answer

If you are looking to install some common command line tools which are not included in Mac OS X, you might have some success in the Rudix program, which offers pre-compiled versions of many utilities in a ready-to-install DMG/pkg format.

Rudix: The hassle-free way to get Unix programs on Mac OS X

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.