aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc7
1 files changed, 4 insertions, 3 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 088182ef..4ca8b176 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -4,6 +4,10 @@ case $- in
*) return ;;
esac
+# Don't do anything if restricted, not even sourcing the ENV file
+# Testing $- for "r" doesn't work
+[ -n "$BASH_VERSINFO" ] && shopt -q restricted_shell && return
+
# 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"
@@ -17,9 +21,6 @@ esac
((10#${BASH_VERSINFO[1]%%[!0-9]*} < 5)) &&
return
-# Don't do anything if running a restricted shell
-shopt -q restricted_shell && return
-
# Keep around 32K lines of history in file
HISTFILESIZE=$((1 << 15))