3

I would like to add TextWrangler to the path environment. I have tried with this command on the terminal:

alias textwrangler=/Applications/TextWrangler.app

and then tried to call it just typing textwrangler, but as you can imagine, it's not working.

I did it in this way, because I had done the same thing for mysql, and it had worked.

I know there are other possibilities to add an application to the path environment, but I would like to know what is the secure way to do it. Can you describe it?

By the way, what I did, as I understood, is not exactly adding TextWrangler to the path environment...

2

Your alias which you have configured will change the working directory in shells which support changing directory without 'cd' to the application bundle of TextWrangler.

To have an alias which opens an app, you will need to run the binary in the app bundle, usually located in Contents/MacOS. For example…

alias textwrangler=/Applications/TextWrangler.app/Contents/MacOS/TextWrangler

The binary in TextWrangler also understands arguments for passing files, which will mean that you can now edit files using the following. This won't work with every app though.

textwrangler /path/to/file

I'm not sure I understand what you're trying to add to your path, but if you want to add the binary to your path, you can add the containing folder:

export PATH=$PATH:/Applications/TextWrangler.app/Contents/MacOS

To add the alias to every interactive shell session, add the alias line to one of the profile files for your shell.

  • The first sentance appears to about something else. You out to add a bit about TextxtWrangeler being an app and mysql just a plain Unix executable – Mark Oct 7 '14 at 21:45
  • @Mark The first sentence is a reference to OP's alias in the question and why it won't work. – grg Oct 8 '14 at 5:57
  • aliases don't change directory (unless they have cd in) – Mark Oct 8 '14 at 10:30
  • @Mark "in shells which support it" – grg Oct 8 '14 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .