not all awks are created equal, so use sub() instead of gensub() in _killall()

This commit is contained in:
ianmacd 2002-01-31 17:03:19 +00:00
parent f9ad911370
commit 514bc14054

View File

@ -2,7 +2,7 @@
#
# <![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>
#
@ -350,7 +350,7 @@ _killall()
# evaluation takes care of swapped out processes, and the
# second takes care of getting the basename of the process)
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#^.*/##' ) )
return 0
fi
@ -369,7 +369,7 @@ _killall()
# get processes, adding to signals if applicable
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#^.*/##' ))
return 0
}