@ -194,7 +194,7 @@ _filedir()
@@ -194,7 +194,7 @@ _filedir()
#glob=$(set +o|grep noglob) # save glob setting.
#set -f # disable pathname expansion (globbing)
if [ " ${ 1 :- } " = -d ] ; then
if [ [ " ${ 1 :- } " = -d ] ] ; then
COMPREPLY = ( ${ COMPREPLY [@] :- } $( compgen -d -- $cur ) )
#eval "$glob" # restore glob setting.
return 0
@ -256,9 +256,9 @@ _available_interfaces()
@@ -256,9 +256,9 @@ _available_interfaces()
{
local cmd
if [ " ${ 1 :- } " = -w ] ; then
if [ [ " ${ 1 :- } " = -w ] ] ; then
cmd = "iwconfig"
elif [ " ${ 1 :- } " = -a ] ; then
elif [ [ " ${ 1 :- } " = -a ] ] ; then
cmd = "ifconfig"
else
cmd = "ifconfig -a"
@ -272,7 +272,7 @@ _available_interfaces()
@@ -272,7 +272,7 @@ _available_interfaces()
#
_expand( )
{
[ " $cur " != " ${ cur % \\ } " ] && cur = " $cur \\ "
[ [ " $cur " != " ${ cur % \\ } " ] ] && cur = " $cur \\ "
# expand ~username type directory specifications
if [ [ " $cur " = = \~ */* ] ] ; then
@ -455,7 +455,7 @@ _function()
@@ -455,7 +455,7 @@ _function()
prev = ${ COMP_WORDS [COMP_CWORD-1] }
if [ [ $1 = = @( declare| typeset ) ] ] ; then
if [ " $prev " = -f ] ; then
if [ [ " $prev " = -f ] ] ; then
COMPREPLY = ( $( compgen -A function -- $cur ) )
elif [ [ " $cur " = = -* ] ] ; then
COMPREPLY = ( $( compgen -W '-a -f -F -i -r -x -p' -- \
@ -527,7 +527,7 @@ complete -F _complete complete
@@ -527,7 +527,7 @@ complete -F _complete complete
# start of section containing completion functions for external programs
# a little help for FreeBSD ports users
[ $UNAME = FreeBSD ] && complete -W ' index search fetch fetch-list \
[ [ $UNAME = FreeBSD ] ] && complete -W ' index search fetch fetch-list \
extract patch configure build install reinstall \
deinstall clean clean-depends kernel buildworld' make
@ -717,8 +717,8 @@ _insmod()
@@ -717,8 +717,8 @@ _insmod()
prev = ${ COMP_WORDS [COMP_CWORD-1] }
# behave like lsmod for modprobe -r
if [ $1 = "modprobe" ] &&
[ " ${ COMP_WORDS [1] } " = "-r" ] ; then
if [ [ $1 = "modprobe" ] ] &&
[ [ " ${ COMP_WORDS [1] } " = "-r" ] ] ; then
COMPREPLY = ( $( /sbin/lsmod | \
awk '{if (NR != 1 && $1 ~ /^' $cur '/) print $1}' ) )
return 0
@ -748,8 +748,8 @@ complete -F _insmod $filenames insmod modprobe modinfo
@@ -748,8 +748,8 @@ complete -F _insmod $filenames insmod modprobe modinfo
# man(1) completion
#
[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-o $UNAME = OpenBSD ] &&
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-o $UNAME = OpenBSD ] &&
_man( )
{
local cur prev sect manpath UNAME
@ -993,8 +993,8 @@ _find()
@@ -993,8 +993,8 @@ _find()
-noleaf -version -xdev '
COMPREPLY = ( $( echo " ${ COMP_WORDS [@] } " | \
( while read -d ' ' i; do
[ " $i " = = "" ] ||
[ " ${ onlyonce / ${ i %% * } / } " = = " $onlyonce " ] &&
[ [ " $i " = = "" ] ] ||
[ [ " ${ onlyonce / ${ i %% * } / } " = = " $onlyonce " ] ] &&
continue
# flatten array with spaces on either side,
# otherwise we cannot grep on word boundaries of
@ -2338,7 +2338,7 @@ _chsh()
@@ -2338,7 +2338,7 @@ _chsh()
cur = ${ COMP_WORDS [COMP_CWORD] }
prev = ${ COMP_WORDS [COMP_CWORD-1] }
if [ " $prev " = "-s" ] ; then
if [ [ " $prev " = "-s" ] ] ; then
if [ -f /etc/debian_version ] ; then
COMPREPLY = ( $( </etc/shells ) )
else
@ -9283,7 +9283,7 @@ if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \
@@ -9283,7 +9283,7 @@ if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \
-x $BASH_COMPLETION_DIR ] ; then
for i in $BASH_COMPLETION_DIR /*; do
[ [ ${ i ##*/ } != @( *~| *.bak| *.swp| \# *\# | *.dpkg*| .rpm*) ] ] &&
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
[ \( -f $i -o -h $i \) -a -r $i ] && . $i 2>& -
done
fi
unset i