.bashrc not getting sourced


#1

Whenever I log in using ssh, I have to manually source my .bashrc file. My default shell is set to /bin/bash. Has anyone else had this problem?

tim


#2

.bashrc is only executed for interactive non-login shells (see the Invocation section of man bash).

.bash_profile is executed for login shells. I use the following lines in my .bash_profile to execute .bashrc if it exists:

if [ -f ~/.bashrc ]; then . ~/.bashrc fi


#3

Thanks, that did the trick.