From 8cce83e72e3d1ff3cd83ec2e91146b93ff9b0775 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 27 May 2015 18:16:22 +1200 Subject: More robust/careful version checking --- bash/bash_profile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bash/bash_profile') diff --git a/bash/bash_profile b/bash/bash_profile index bf2fa92c..d3f9f9b0 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -3,9 +3,12 @@ if test -e "$HOME"/.profile ; then . "$HOME"/.profile fi -# Give up completely if no BASH_VERSINFO (<2.0) -if ! test "$BASH_VERSINFO" ; then +# Ensure we're using at least version 2.05 +if ! test -n "$BASH_VERSINFO" ; then return +elif ((10#${BASH_VERSINFO[0]%%[![:digit:]]} == 2)) \ + && ((10#${BASH_VERSINFO[1]%%[![:digit:]]} < 5)) ; then + return fi # Source interactive Bash config if it exists -- cgit v1.2.3