diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-17 20:12:32 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-17 20:12:32 +1200 |
commit | 616ed83639d012bd95953f839a81737d2c30b9d4 (patch) | |
tree | c9faa77cff822b3d900e31e552c53a60bac6a253 /bash/bashrc | |
parent | Move ksh ENV handling into shrc.d (diff) | |
download | dotfiles-616ed83639d012bd95953f839a81737d2c30b9d4.tar.gz dotfiles-616ed83639d012bd95953f839a81737d2c30b9d4.zip |
Simplify end-of-file loop in bashrc
Diffstat (limited to 'bash/bashrc')
-rw-r--r-- | bash/bashrc | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/bash/bashrc b/bash/bashrc index e719efee..ef80a8eb 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -106,28 +106,12 @@ if [[ $COMP_WORDBREAKS ]] ; then COMP_WORDBREAKS=${COMP_WORDBREAKS//:} fi -# If this wasn't a login shell, load in the POSIX shell functions -case $- in - *l*) ;; - *) - for shrc in "$HOME"/.shrc.d/*.sh ; do - [[ -e $shrc ]] || continue - source "$shrc" - done - unset -v shrc - ;; -esac - -# Load any supplementary scripts -for bashrc in "$HOME"/.bashrc.d/*.bash ; do - [[ -e $bashrc ]] || continue - source "$bashrc" -done -unset -v bashrc - -# Load any completion files -for bashcmp in "$HOME"/.bash_completion.d/*.bash ; do - [[ -e $bashcmp ]] || continue - source "$bashcmp" +# Load POSIX shell functions, Bash-specific scripts, and Bash completion files, +# in that order +for sh in "$HOME"/.shrc.d/*.sh \ + "$HOME"/.bashrc.d/*.bash \ + "$HOME"/.bash_completion.d/*.bash ; do + [[ -e $sh ]] || continue + source "$sh" done -unset -v bashcmp +unset -v sh |