aboutsummaryrefslogblamecommitdiff
path: root/bash/bash_profile
blob: 9d2fd76c0382d089e8f5dc6213ed419ab005ddd3 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                             
                                 


                      


                                                                               
                                   
          
                                 
                                                         
          

  
                                

                                                           

                                          



                         



                                                                              
# Load ~/.profile regardless of shell version
if [ -e "$HOME"/.profile ] ; then
    . "$HOME"/.profile
fi

# Ensure we're using at least version 2.05. Weird arithmetic syntax needed here
# due to leading zeroes and trailing letters in some 2.x version numbers (e.g.
# 2.05a).
if ! [ -n "$BASH_VERSINFO" ] ; then
    return
elif ((BASH_VERSINFO[0] == 2)) &&
     ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
    return
fi

# Load any supplementary scripts
if [[ -d $HOME/.bash_profile.d ]] ; then
    for bash_profile in "$HOME"/.bash_profile.d/*.bash ; do
        [[ -e $bash_profile ]] || continue
        source "$bash_profile"
    done
    unset -v bash_profile
fi

# If ~/.bashrc exists, source that too; the test for interactivity is in there
if [[ -f $HOME/.bashrc ]] ; then
    source "$HOME"/.bashrc
fi