From f7e5f83f2ad6f0bfaff75ce16d67088f1797e242 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 17 Aug 2016 17:42:55 +1200 Subject: Move -i test in Bash to end of ~/.bash_profile --- bash/bash_profile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bash/bash_profile') diff --git a/bash/bash_profile b/bash/bash_profile index ee735720..d0850004 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -23,7 +23,7 @@ if [[ -d $HOME/.bash_profile.d ]] ; then unset -v bash_profile fi -# Source interactive Bash config if it exists -if [[ -e $HOME/.bashrc ]] ; then - source "$HOME"/.bashrc -fi +# If the shell is interactive, and ~/.bashrc exists, source that too +case $- in + *i*) [[ -f "$HOME"/.bashrc ]] && source "$HOME"/.bashrc ;; +esac -- cgit v1.2.3