I have read just about every article on this subject. To wit, I know about:

  • launchctl setenv
  • /etc/launchd.conf
  • /etc/paths
  • /etc/paths.d/*
  • /etc/profile
  • /etc/bashrc
  • ~/.profile
  • ~/.bashrc
  • ~/.MacOSX/environment.plist
  • ~/Library/Preferences/.MacOSX/environment.plist

Let's start whittling all this craziness down:

  • From other reading, I know that on Mavericks anything that relies on an environment.plist is no longer supported or read.
  • I know that /etc/profile erases any PATH previously set by launchctl setenv or present in /etc/launchd.conf, and uses a default set of paths appended with anything found in /etc/paths.d/* and /etc/paths.
  • I also know that applications launched via Spotlight or the Dock obviously don't read your ~/.profile or ~/.bashrc.

That leaves launchctl setenv and /etc/launchd.conf (same thing, really).

At any rate, in my case I find that in a Terminal window—I should stress I have none of the following files: ~/.profile, ~/.bashrc, ./bash_profile—I find that the output of env | grep PATH has /opt/subversion/bin appended to the end of it. This string does not show up in any of the sources listed above, so it must be coming from somewhere else. I was not aware of there being anywhere else for it to come from.

So then: how does Mac OS X Mavericks build its PATH variable?

  • Where did you get your installation of subversion? – Alistair McMillan Jul 30 '14 at 23:31
  • 1
    Found the root of my own personal problem: there was an emacs backup file in /etc/paths.d that had the old information in it that was not being shown by ls given the way I was invoking it. I'd still be interested in the full list, which I've never seen anywhere. – Laird Nelson Jul 30 '14 at 23:36

You're trying to understand the theory and that's great. I'll just say that from practical experience, you can modify .bashrc, .profile and/or .bash_profile and the path setting will stick. I prefer ~/.profile simply out of habit. My teammates all use .bash_profile. Either way it works as long as you pay attention to the order of processing precedence.

Here are a few other thoughts on the matter:

Hope that helps.

  • Hi; thanks for your answer. The PATH setting in that case won't stick for my Emacs.app launched from the Dock or from Spotlight. Since I don't want to have duplicate PATH entries in both /etc/launchd.conf and ~/.profile, I was hoping for the full startup sequence to see if I could find the common denominator. – Laird Nelson Jul 31 '14 at 18:32
  • what if you modify .profile to include what you want, use Automator to call a shell script that simply says bash open -fa /Applications/Emacs.app (or whatever the path is) and see if that works. Or maybe there's a PATH option buried somewhere in the Emacs Preferences? – SaxDaddy Aug 5 '14 at 23:26

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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