How to Create a Permanent Alias in Mac OS X Lion Terminal?
Without more details of what's going wrong it's hard to tell for sure, but I see three suspicious things off the top of my head:
You source ~/.bashrc twice (once with
.
, then again withsource
). Once really should be enough.In general, I'd recommend setting aliases in .bashrc (and then sourcing it (once) from .bash_profile). That way, the aliases are available in both login shells and subshells. Creating an alias in .bash_profile means it'll only be available in login shells.
Isn't /usr/local/rvm/scripts/rvm the appropriate file to set up rvm definitions?
Waley Chen
Updated on September 18, 2022Comments
-
Waley Chen over 1 year
I've googled the heck out of this. The typical methods of adding the alias to ~/.bashrc or ~/.bash_profile just aren't working for me. Help please? Thanks!
Here's my current ~/.bash_profile
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi export PATH="$HOME/bin:${PATH}" source ~/.bashrc alias jm.mobi="ssh [email protected]" # put this at the very end of your bash file [[ -s "/usr/local/rvm/bin/rvm" ]] && . "/usr/local/rvm/bin/rvm" # This loads RVM into a shell session.
Also, when I source ~/.bashrc or ~/.bash_profile it logs me out of root, strange ...
-
Waley Chen over 12 yearsstackoverflow.com/questions/2309103/… - The second comment in the last answer in the thread helped me figure out what's going on/what's being load and what not.
-