Where are our paths?

Lost when it comes to Leopard's paths? They're all important when you compile your own stuff and will drive you nuts at some stage, so after quite a bit of stuffing around (my incompetence, not theirs), I've decided to list the path to path in ORDER.

The key thing to note is that in Leopard, in addition to the standard /etc/paths, Apple have created a 'path_helper' script (called from /etc/paths), that picks up path directories from two new special locations.

1) A text file call /etc/paths
2) any file you put in /etc/paths.d

Before this, your own .bash_profile is read from ~/.bash_profile or, for root, /var/root/.profile in the standard way.

So...the order for your paths is:
  1. ~/bash_login or ~/.profile (if you have you path like xxxxx:$PATH)
  2. /etc/profile (mine contains JAVA_HOME)
  3. /etc/paths
  4. /etc/paths.d/*

If you've installed your own software in /usr/local, you'll probably want to edit /etc/paths first, as this gets set up first too, and you generally want to override /usr/bin, /bin, /sbin and /usr/sbin to get your own stuff going first.

The general commands in your script are simply
XXXX=/your/path
export XXXX

Comments

Popular Posts