aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-01-05 23:08:01 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-01-05 23:08:01 +1300
commit632e1530698eef96993bddcac11f207ee8cc8a9c (patch)
treece1dd5ef6ea36beb77ff578adf6c803be987a895 /bash
parentMerge branch 'release/v4.8.0' into develop (diff)
downloaddotfiles-632e1530698eef96993bddcac11f207ee8cc8a9c.tar.gz
dotfiles-632e1530698eef96993bddcac11f207ee8cc8a9c.zip
Explain .bashrc $- 'r' flag problem fully
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc5
1 files changed, 3 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 0400e41d..6e4c31a9 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -4,8 +4,9 @@ case $- in
*) return ;;
esac
-# Don't do anything if restricted, not even sourcing the ENV file
-# Testing $- for "r" doesn't work
+# Don't do anything if restricted, not even sourcing the ENV file; testing
+# whether $- contains 'r' doesn't work, because Bash doesn't set that flag
+# until after .bashrc has evaluated
! shopt -q restricted_shell 2>/dev/null || return
# Clear away all aliases; we do this here rather than in the $ENV file shared