Bash dot files

From braindump
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

if [ -f /etc/profile ]; then 
    source /etc/profile
fi 
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