Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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"ssh wz3chen@"

# 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 ...

share|improve this question

migrated from Oct 21 '11 at 4:35

This question came from our site for professional and enthusiast programmers.… - 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. – Waley Chen Oct 16 '11 at 6:13
up vote 2 down vote accepted

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:

  1. You source ~/.bashrc twice (once with ., then again with source). Once really should be enough.

  2. 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.

  3. Isn't /usr/local/rvm/scripts/rvm the appropriate file to set up rvm definitions?

share|improve this answer
I set aliases in .bashrc and then goign into "bash" works. Thanks! – Waley Chen Oct 16 '11 at 6:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .