From 8f76e879b4fa51635d366eeacaa84e3426d1fc02 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Thu, 16 Jun 2016 10:26:04 +0100 Subject: [PATCH] Add code to exit .bashrc on non-interactive shells. --- .bashrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.bashrc b/.bashrc index bcadfe5..d69902b 100755 --- a/.bashrc +++ b/.bashrc @@ -1,3 +1,11 @@ +#-------------------------------------------------------------------------------- +# Exit for non-interactive sessions +#-------------------------------------------------------------------------------- +if [ -z "$PS1" ]; then + return +fi +#-------------------------------------------------------------------------------- + #-------------------------------------------------------------------------------- # Function to prepend PATH only if it doesn't already exist #--------------------------------------------------------------------------------