check that $modpath directory can be entered in _insmod()
This commit is contained in:
parent
c3562cad68
commit
0d6c8060b2
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05a
|
# bash_completion - some programmable completion functions for bash 2.05a
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.127 2002/02/18 18:26:54 ianmacd Exp $
|
# $Id: bash_completion,v 1.128 2002/02/18 18:36:00 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -264,10 +264,12 @@ _insmod()
|
|||||||
# do module parameter completion
|
# do module parameter completion
|
||||||
COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} | \
|
COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} | \
|
||||||
awk '{if ($1 ~ /^'$cur'/) print $1}' ) )
|
awk '{if ($1 ~ /^'$cur'/) print $1}' ) )
|
||||||
else
|
elif [ -r $modpath -a -x $modpath ]; then
|
||||||
# do module name completion
|
# do module name completion
|
||||||
COMPREPLY=( $( \ls -R $modpath | \
|
COMPREPLY=( $( \ls -R $modpath | \
|
||||||
sed -ne 's/^\('$cur'.*\)\.o$/\1/p') )
|
sed -ne 's/^\('$cur'.*\)\.o$/\1/p') )
|
||||||
|
else
|
||||||
|
COMPREPLY=( $( compgen -f $cur ) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
@ -364,7 +366,7 @@ _killall()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# get processes, adding to signals if applicable
|
# get processes, adding to signals if applicable
|
||||||
COMPREPLY=( ${COMPREPLY[*]} $( ps ahx | sed -e 's#[]\[()]##g' | \
|
COMPREPLY=( ${COMPREPLY[@]} $( ps ahx | sed -e 's#[]\[()]##g' | \
|
||||||
awk '{p=$5;sub("^.*/","",p);if (p ~ /^'$cur'/) print $5}' | \
|
awk '{p=$5;sub("^.*/","",p);if (p ~ /^'$cur'/) print $5}' | \
|
||||||
sed -e 's#^.*/##' ))
|
sed -e 's#^.*/##' ))
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user