aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_profile
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-30 14:07:45 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-30 14:07:45 +1300
commita2b5f3e2c173284a85401794697ba6925c74b30c (patch)
tree8b97c74ff1284e6794f855bda9fb76d31714248c /bash/bash_profile
parentda4e6a80a24bc1002e06b0b4a386254a5d5cb050 (diff)
downloaddotfiles-a2b5f3e2c173284a85401794697ba6925c74b30c.tar.gz
dotfiles-a2b5f3e2c173284a85401794697ba6925c74b30c.zip
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.
Diffstat (limited to 'bash/bash_profile')
-rw-r--r--bash/bash_profile10
1 files changed, 7 insertions, 3 deletions
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