diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-05-27 18:16:22 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-05-27 18:16:22 +1200 |
commit | 8cce83e72e3d1ff3cd83ec2e91146b93ff9b0775 (patch) | |
tree | 17ef89ff6593112007fde2a285ea7140e34ba476 /bash/bash_logout | |
parent | Always source ~/.profile in ~/.bash_profile (diff) | |
download | dotfiles-8cce83e72e3d1ff3cd83ec2e91146b93ff9b0775.tar.gz dotfiles-8cce83e72e3d1ff3cd83ec2e91146b93ff9b0775.zip |
More robust/careful version checking
Diffstat (limited to 'bash/bash_logout')
-rw-r--r-- | bash/bash_logout | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bash/bash_logout b/bash/bash_logout index 6f539b04..96fc4e3c 100644 --- a/bash/bash_logout +++ b/bash/bash_logout @@ -1,6 +1,9 @@ -# 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 # Clear console if possible when logging out |