From 95fdd499d926749ce5102031b8e3ca196119edd6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 9 Nov 2008 20:50:01 +0100 Subject: pkill completion: Don't use cut --- etc/completions/_pkill | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/completions/_pkill b/etc/completions/_pkill index 46f5939..f4f4b24 100644 --- a/etc/completions/_pkill +++ b/etc/completions/_pkill @@ -3,7 +3,6 @@ ## Written 2008 by Daniel Friesel ## Not finished -## * The process completion needs some rework (what about sudo?) ## * Some options lack completion / their completion is inspecific typeset -a arguments @@ -36,12 +35,14 @@ function _terminal { } function _named_process { - typeset -a pgrep_user + typeset -a pgrep_user processes + typeset IFS=$'\n' if (( EUID )) { pgrep_user=(-u $EUID) } + processes=($(pgrep $pgrep_user -l '')) _wanted pattern expl 'pattern or process name' \ - compadd $(pgrep $pgrep_user -l '' | cut -d ' ' -f 2) + compadd ${processes#* } } _arguments -s $arguments -- cgit v1.2.3