aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc8
1 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index a48a9081..1c7d7802 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -4,6 +4,10 @@ case $- in
*) return ;;
esac
+# If ENV is set, source it to get all the POSIX-compatible interactive stuff;
+# we should be able to do this even if we're running a truly ancient Bash
+[ -n "$ENV" ] && . "$ENV"
+
# 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).
@@ -82,8 +86,8 @@ if ((BASH_VERSINFO[0] >= 4)) ; then
((BASH_VERSINFO[1] >= 3)) && shopt -s direxpand
fi
-# Load POSIX shell startup files and then Bash-specific ones
-for sh in "$ENV" "$HOME"/.bashrc.d/*.bash ; do
+# Load Bash-specific startup files
+for sh in "$HOME"/.bashrc.d/*.bash ; do
[[ -e $sh ]] && source "$sh"
done
unset -v sh