From a2b5f3e2c173284a85401794697ba6925c74b30c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 14:07:45 +1300 Subject: Use ||/&& short-circuiting only for flow control If we're doing something besides return/exit, it should be a proper `if` condition so that the semantics are clearer. --- bash/bash_profile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bash/bash_profile') diff --git a/bash/bash_profile b/bash/bash_profile index 0376ee57..1f5a633a 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -1,5 +1,7 @@ # Load ~/.profile regardless of shell version -[ -e "$HOME"/.profile ] && . "$HOME"/.profile +if [ -e "$HOME"/.profile ] ; then + . "$HOME"/.profile +fi # If POSIXLY_CORRECT is set after doing that, force the `posix` option on and # don't load the rest of this stuff--so, just ~/.profile and ENV @@ -9,5 +11,7 @@ if [ -n "$POSIXLY_CORRECT" ] ; then fi # If ~/.bashrc exists, source that too; the tests for both interactivity and -# >=2.05a (for features like [[) are in there -[ -f "$HOME"/.bashrc ] && . "$HOME"/.bashrc +# minimum version numbers are in there +if [ -f "$HOME"/.bashrc ] ; then + . "$HOME"/.bashrc +fi -- cgit v1.2.3