From d9449c1599ee34a6dd4eac84cf209d9e9017ab69 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 30 Jul 2016 01:32:30 +1200 Subject: Use terser syntax for .d loop sources --- bash/bashrc | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'bash/bashrc') diff --git a/bash/bashrc b/bash/bashrc index 7338b64c..b551819d 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -106,21 +106,15 @@ if [[ $COMP_WORDBREAKS ]] ; then fi # Load any supplementary scripts -if [[ -d $HOME/.bashrc.d ]] ; then - for bashrc in "$HOME"/.bashrc.d/*.bash ; do - if [[ -e $bashrc ]] ; then - source "$bashrc" - fi - done - unset -v bashrc -fi +for bashrc in "$HOME"/.bashrc.d/*.bash ; do + [[ -e $bashrc ]] || continue + source "$bashrc" +done +unset -v bashrc # Load any completion files -if [[ -d $HOME/.bash_completion.d ]] ; then - for bashcmp in "$HOME"/.bash_completion.d/*.bash ; do - if [[ -e $bashcmp ]] ; then - source "$bashcmp" - fi - done - unset -v bashcmp -fi +for bashcmp in "$HOME"/.bash_completion.d/*.bash ; do + [[ -e $bashcmp ]] || continue + source "$bashcmp" +done +unset -v bashcmp -- cgit v1.2.3