# Set up _base, _self first # Keep track of which config set is loaded, to avoid loading a config set more than once if [ -z "${__BASH_CONFIG_LOADED}" ] || echo "${__BASH_CONFIG_LOADED}" | grep -qv " ${_self} " then __BASH_CONFIG_LOADED="${__BASH_CONFIG_LOADED} ${_self} " # Interactive shell? _i() { [[ $- == *i* ]]; return $?; } # Include all subfiles, in lexicographical order eval "$( ( [ -d "${_base}/${_self}.d/" ] && echo "${_base}/${_self}.d/" [ -d "${HOME}/.${_self}.d/" ] && echo "${HOME}/.${_self}.d/" ) | while read _path do find ${_path} -type f | sort done | sed -e 's/^/source /; s/$/;/' )" unset _base _self _i fi