aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_profile8
-rw-r--r--bash/bashrc6
2 files changed, 10 insertions, 4 deletions
diff --git a/bash/bash_profile b/bash/bash_profile
index d0850004..76758083 100644
--- a/bash/bash_profile
+++ b/bash/bash_profile
@@ -23,7 +23,7 @@ if [[ -d $HOME/.bash_profile.d ]] ; then
unset -v bash_profile
fi
-# If the shell is interactive, and ~/.bashrc exists, source that too
-case $- in
- *i*) [[ -f "$HOME"/.bashrc ]] && source "$HOME"/.bashrc ;;
-esac
+# If ~/.bashrc exists, source that too; the test for interactivity is in there
+if [[ -f $HOME/.bashrc ]] ; then
+ source "$HOME"/.bashrc
+fi
diff --git a/bash/bashrc b/bash/bashrc
index 56ab7fda..5b04f979 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -8,6 +8,12 @@ elif ((BASH_VERSINFO[0] == 2)) &&
return
fi
+# Make sure the shell is interactive
+case $- in
+ *i*) ;;
+ *) return ;;
+esac
+
# Don't do anything if running a restricted shell
if shopt -q restricted_shell ; then
return