diff --git a/.profile b/.profile index 453f839..5218209 100644 --- a/.profile +++ b/.profile @@ -43,11 +43,11 @@ export GCC_COLORS=auto ssh-add "$HOME/.ssh/admin@homeserver" >/dev/null 2>&1 } -# if executing interactively -# execute .bashrc in the current login context -case $- in -*i*) ;; -*) return ;; -esac -[ -z "${PS1-}" ] && return -[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" +#shellcheck disable=SC1091 +# Source ~/.bashrc, when in interactive mode, but not POSIX/sh mode. +[ "$BASH" ] && + [ "$PS1" ] && + [ -z "$POSIXLY_CORRECT" ] && + [ "${0#-}" != 'sh' ] && + [ -r "$HOME/.bashrc" ] && + . "$HOME/.bashrc"