From 632e1530698eef96993bddcac11f207ee8cc8a9c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 5 Jan 2019 23:08:01 +1300 Subject: Explain .bashrc $- 'r' flag problem fully --- bash/bashrc | 5 +++-- 1 file 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 -- cgit v1.2.3