From 7ddb8084297c5bf30db73e9b9058d71f52991901 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 21 Aug 2016 21:09:15 +1200 Subject: Many stylistic fixes/optimisations In particular, limit the verbose >=2.05 test to just one file: .bashrc --- bash/bash_profile | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'bash/bash_profile') diff --git a/bash/bash_profile b/bash/bash_profile index 69350102..69e812a0 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -1,19 +1,6 @@ # Load ~/.profile regardless of shell version -if [ -e "$HOME"/.profile ] ; then - . "$HOME"/.profile -fi +[ -e "$HOME"/.profile ] && . "$HOME"/.profile -# Ensure we're using at least version 2.05. Weird arithmetic syntax needed here -# due to leading zeroes and trailing letters in some 2.x version numbers (e.g. -# 2.05a). -if ! [ -n "$BASH_VERSINFO" ] ; then - return -elif ((BASH_VERSINFO[0] == 2)) && - ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then - return -fi - -# If ~/.bashrc exists, source that too; the test for interactivity is in there -if [[ -f $HOME/.bashrc ]] ; then - source "$HOME"/.bashrc -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 -- cgit v1.2.3