Tom McFarlin wrote a nice primer on Bash for WordPress developers. It covers what your
bash_profile is and how to manage third-party software with it.
You should also check out Tom’s recent project of a simple autoloader for WordPress. It’s an autoloader that you can drop into a WordPress plugin and begin using it right away. Tom acknowledges that it’s a foundation off of which to build and to which others can contribute.