bash-completion/bash-completion.profile
Ville Skyttä 9f7c845833 - Don't source ourselves in non-interactive shells (#180419, Behdad
Esfahbod).
- Trigger-install snippets for clisp, gnatmake, isql, ri, sbcl, and
    snownews.
2006-02-08 16:55:38 +00:00

15 lines
474 B
Plaintext

# check for bash (and that we haven't already been sourced, see eg. #174355)
[ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
# skip non-interactive shells
[[ $- == *i* ]] || return
# check for correct version of bash
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
if [ -r /etc/bash_completion ] && \
[ $bmajor -eq 2 -a $bminor '>' 04 -o $bmajor -gt 2 ] ; then
# source completion code
. /etc/bash_completion
fi
unset bash bminor bmajor