Difference between revisions of "Bash dot files"

From braindump
Jump to navigation Jump to search
Line 1: Line 1:
Login Shell (e.g. bash --login):
Login:
source /etc/profile
source /etc/profile
if [ -f ~/.bash_profile ]; then
if [ -f ~/.bash_profile ]; then
Line 13: Line 13:
source ~/.profile
source ~/.profile
return
return
fi

Non-login Shell (e.g. run bash from within another shell):
if [ -f ~/.bashrc ]; then
source ~/.bashrc
return
fi
fi

Revision as of 03:15, 26 January 2011

Login Shell (e.g. bash --login):

source /etc/profile
if [ -f ~/.bash_profile ]; then
   source ~/.bash_profile
   return
fi 

if [ -f ~/.bash_login ]; then 
   source ~/.bash_login
   return
fi
if [ -f ~/.profile ]; then 
   source ~/.profile
   return
fi

Non-login Shell (e.g. run bash from within another shell):

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