SOURCES: bash-completion.sh (NEW) - script to load bash_completion

glen glen at pld-linux.org
Wed Mar 1 20:59:05 CET 2006


Author: glen                         Date: Wed Mar  1 19:59:05 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- script to load bash_completion

---- Files affected:
SOURCES:
   bash-completion.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/bash-completion.sh
diff -u /dev/null SOURCES/bash-completion.sh:1.1
--- /dev/null	Wed Mar  1 20:59:05 2006
+++ SOURCES/bash-completion.sh	Wed Mar  1 20:58:59 2006
@@ -0,0 +1,16 @@
+# $Id$
+
+# Check for bash (and that we haven't already been sourced).
+[ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
+
+# must be interactive shell, not script
+[[ $- = *i* ]] || return
+[ -n "$PS1" ] || return
+
+# Check for recent enough version of bash.
+bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
+	# Source completion code
+	. /etc/bash_completion
+fi
+unset bash bminor bmajor
================================================================


More information about the pld-cvs-commit mailing list