Use more straightforward way to check bash version
This commit is contained in:
parent
38a013e22c
commit
768a958546
@ -2,8 +2,8 @@
|
||||
if [ -n "$BASH_VERSION" -a -n "$PS1" -a -z "$BASH_COMPLETION_COMPAT_DIR" ]; then
|
||||
|
||||
# Check for recent enough version of bash.
|
||||
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
|
||||
if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
|
||||
if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
|
||||
[ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
|
||||
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
|
||||
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
|
||||
if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
|
||||
@ -11,6 +11,5 @@ if [ -n "$BASH_VERSION" -a -n "$PS1" -a -z "$BASH_COMPLETION_COMPAT_DIR" ]; then
|
||||
. @pkgdatadir@/bash_completion
|
||||
fi
|
||||
fi
|
||||
unset bash bmajor bminor
|
||||
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user