greycat 1601406164 learn To see where a variable is coming from in a login shell: PS4='+ $BASH_SOURCE:$FUNCNAME:$LINENO:' bash -ilxc : 2>&1 | grep myvar; ## or in a non-login shell, use -ixc instead of -ilxc greycat 1601406208 forget greycat 1601406222 learn To see where a variable is coming from in a login shell: PS4='+ $BASH_SOURCE:$FUNCNAME:$LINENO:' bash -ilxc : 2>&1 | grep myvar; ## or in a non-login shell, use -ixc instead of -ilxc ## This does NOT work as root. It does NOT cover variables that come from PAM, etc.