Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using OSX Mountain Lion 10.8.2

$echo $PATH prints this:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/myusername/.rvm/bin

I've commented out everything in ~/.bash_profile and ~/.bashrc and restarted the computer, but the last part in the $PATH variable(/Users/myusername/.rvm/bin) does not go away.

How can I find out where that last part gets added to my $PATH variable?

share|improve this question
    
Did you restart current shell after changes in config files? –  rush Mar 20 '13 at 9:30
    
yes, I've restarted the Terminal. –  Yeonho Mar 20 '13 at 9:31
add comment

1 Answer

up vote 4 down vote accepted

man bash's INVOCATION section explains which files are involved in starting an interactive login shell session:

  • /etc/profile
  • ~/.bash_profile
  • ~/.bash_login
  • ~/.profile

Any of these could contain this assignment or a source / . statement to source another script which contains this assignment. Since you've already checked the last two, try looking into the first two and any files that any of these source. This typically includes /etc/profile.d/*, which often contains application-specific PATH assignments.

In my specific case (Ubuntu 12.10) these four files source the following:

  • /etc/profile:
    • /etc/bash.bashrc
    • /etc/profile.d/*.sh
  • ~/.bash_profile doesn't exist
  • ~/.bash_login doesn't exist
  • ~/.profile:
    • $HOME/.bashrc

RVM specifically requests that you source its RC file in ~/.bash_profile for a single user installation, so that's probably a good bet.

share|improve this answer
add comment

Your Answer

 
discard

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.