Super User is a question and answer site for computer enthusiasts and power users. 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 recently migrated my shell over to zsh from bash on my os x computer. I obtained zsh from macports, updated my default shell on os x, and restarted. When I tried to use port both shells said they couldn't find port.

Adding /opt/local/bin to both of their paths fixed this issue (which is interested because bash's path never included /opt/local/bin yet those programs always worked). However, the problem that still persists is programs I've installed over macports no longer work. For example: issuing emacs --version gives version 22 instead of version 24 which I installed over macports.

Does anyone know what could have happened and how I could fix this?

share|improve this question
How did you add the path? Does which -a emacs show you both versions? – slhck May 16 '13 at 21:52
up vote 1 down vote accepted

The easiest solution to this is to start bash, call echo $PATH on it, and then inspect what it contains. Perhaps you never added anything to bash's path yourself, but /etc/profile or even ~/.profile are doing that.

Notice that the directory order in your $PATH matters. If there are 2 emacs installed, the first one found will be picked up. If which -a emacs returns multiple locations, you already have all paths you need, but you probably just placed at the end of $PATH. You should place it in the beginning.

share|improve this answer
This was exactly my problem. I had PATH=$PATH:/opt/local/bin when I wanted PATH=/opt/local/bin:$PATH. So it was finding the out of date version of emacs first. Thank you. – David May 19 '13 at 6:39

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.