not all awks are created equal, so use sub() instead of gensub() in _killall()
This commit is contained in:
parent
f9ad911370
commit
514bc14054
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# <![CDATA[
|
# <![CDATA[
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.80 2002/01/31 17:01:43 ianmacd Exp $
|
# $Id: bash_completion,v 1.81 2002/01/31 18:03:19 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -350,7 +350,7 @@ _killall()
|
|||||||
# evaluation takes care of swapped out processes, and the
|
# evaluation takes care of swapped out processes, and the
|
||||||
# second takes care of getting the basename of the process)
|
# second takes care of getting the basename of the process)
|
||||||
COMPREPLY=( $( ps ahx | sed -e 's#[]\[()]##g' | \
|
COMPREPLY=( $( ps ahx | sed -e 's#[]\[()]##g' | \
|
||||||
awk '{if (gensub("^.*/","",1,$5) ~ /^'$cur'/) print $5}' | \
|
awk '{p=$5;sub("^.*/","",p);if (p ~ /^'$cur'/) print $5}' | \
|
||||||
sed -e 's#^.*/##' ) )
|
sed -e 's#^.*/##' ) )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@ -369,7 +369,7 @@ _killall()
|
|||||||
|
|
||||||
# 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 '{if (gensub("^.*/","",1,$5) ~ /^'$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