Macos – To set PATH on OS X when export PATH= don’t work


I can't do 'export PATH=' When I try that only .swp files is created (.bash_profile.swp and .bashrc.swp). I'm on OS X 10.6.

$ echo $PATH


My .bash_profile , (When installed latest perl this corrected previous errors that .bashrc did not load. It had not done so since I created a .emacs I think)

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
source /Users/masterpriindustriellledning/perl5/perlbrew/etc/bashrc
# Added by
[ -r /Users/masterpriindustriellledning/.bashrc ] && source /Users/masterpriindustriellledning/.bashrc

My .profile

export PATH="/usr/local/bin:$PATH:/usr/local/sbin"

'brew doctor' gives some warnings. Never used brew since my brew does not work.

$ brew doctor

1. Warning: Unbrewed dylibs were found in /usr/local/lib.
2. Warning: Unbrewed static libraries were found in /usr/local/lib.
3. Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. ... Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.
4. Warning: Your Xcode is configured with an invalid path. ... *(brews suggested fix is not working for me)

My tries so far is.

$ grep export .??* , i.e. the things I tried to export to $PATH.

.bash_history:export GRAILS_HOME=/usr/share/java/grails
.bash_history:export PATH=$GRAILS_HOME/bin:$PATH
.profile:export PATH="/usr/local/bin:$PATH:/usr/local/sbin"

$ grep PATH .??*

.bash_history:which PATH
.bash_history:echo $PATH
.bash_history:export PATH=$GRAILS_HOME/bin:$PATH
.bash_history:echo $PATH
.bash_history:echo $PATH
.bash_history:whereis $PATH
.bash_history:which $PATH
.bashrc:PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
Binary file .bashrc.swp matches
.profile:export PATH="/usr/local/bin:$PATH:/usr/local/sbin"
.zshrc:PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

Best Answer

My quick fix. If I have. An empty .bashrc (when I put something there it breaks) , the line PATH="/usr/local/bin:$PATH:/usr/local/sbin" in both .profile and .bash_profile. As Daniel for pointing out terminal does not load .profile if .bash_profile exist.

Related Question