Avoid exit status of 1 when reassigning read-only variables.
This commit is contained in:
parent
e98d8250c8
commit
e82cada3d4
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05b
|
# bash_completion - programmable completion functions for bash 3.0
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.800 2005/07/08 01:47:14 ianmacd Exp $
|
# $Id: bash_completion,v 1.801 2005/07/08 04:20:58 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -33,7 +33,7 @@
|
|||||||
# readonly variable errors.
|
# readonly variable errors.
|
||||||
BASH_COMPLETION="${BASH_COMPLETION:-/etc/bash_completion}"
|
BASH_COMPLETION="${BASH_COMPLETION:-/etc/bash_completion}"
|
||||||
BASH_COMPLETION_DIR="${BASH_COMPLETION_DIR:=/etc/bash_completion.d}"
|
BASH_COMPLETION_DIR="${BASH_COMPLETION_DIR:=/etc/bash_completion.d}"
|
||||||
} 2>/dev/null
|
} 2>/dev/null || :
|
||||||
readonly BASH_COMPLETION BASH_COMPLETION_DIR
|
readonly BASH_COMPLETION BASH_COMPLETION_DIR
|
||||||
|
|
||||||
# Set a couple of useful vars
|
# Set a couple of useful vars
|
||||||
@ -46,7 +46,7 @@ RELEASE=$( uname -r )
|
|||||||
# features supported by bash 2.05 and higher
|
# features supported by bash 2.05 and higher
|
||||||
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] ||
|
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] ||
|
||||||
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
|
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
|
||||||
declare -r bash205=$BASH_VERSION 2>/dev/null
|
declare -r bash205=$BASH_VERSION 2>/dev/null || :
|
||||||
default="-o default"
|
default="-o default"
|
||||||
dirnames="-o dirnames"
|
dirnames="-o dirnames"
|
||||||
filenames="-o filenames"
|
filenames="-o filenames"
|
||||||
@ -54,12 +54,12 @@ fi
|
|||||||
# features supported by bash 2.05b and higher
|
# features supported by bash 2.05b and higher
|
||||||
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] ||
|
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] ||
|
||||||
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
|
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
|
||||||
declare -r bash205b=$BASH_VERSION 2>/dev/null
|
declare -r bash205b=$BASH_VERSION 2>/dev/null || :
|
||||||
nospace="-o nospace"
|
nospace="-o nospace"
|
||||||
fi
|
fi
|
||||||
# features supported by bash 3.0 and higher
|
# features supported by bash 3.0 and higher
|
||||||
if [ ${BASH_VERSINFO[0]} -gt 2 ]; then
|
if [ ${BASH_VERSINFO[0]} -gt 2 ]; then
|
||||||
declare -r bash3=$BASH_VERSION 2>/dev/null
|
declare -r bash3=$BASH_VERSION 2>/dev/null || :
|
||||||
bashdefault="-o bashdefault"
|
bashdefault="-o bashdefault"
|
||||||
plusdirs="-o plusdirs"
|
plusdirs="-o plusdirs"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user