I'm trying to figure out how I can load changes to my .bash_profile
without having to logout of my Bash session or exit Terminal, also without affecting my $PATH
.
In a new session this is my $PATH
:
/Users/MyName/.rbenv/shims:/usr/local/heroku/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/go/bin
And this is the alias I setup to reload my .bash_profile
:
alias reload='source ~/.bash_profile'
When I run the reload
command, my changes to my .bash_profile
are loaded, but my $PATH
is lengthened with each time I run the command.
For example:
>> reload
>> echo $PATH
/Users/MyName/.rbenv/shims:/usr/local/heroku/bin:/usr/local/bin:/Users/MyName/.rbenv/shims:/usr/local/heroku/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/go/bin
As you can see my $PATH
is now longer and I think this is because the following is in my .bash_profile
:
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/heroku/bin:$PATH"
How can I keep my $PATH
from being updated with each reload?