diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-09 20:50:01 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-11-09 20:51:41 +0100 |
commit | 95fdd499d926749ce5102031b8e3ca196119edd6 (patch) | |
tree | 5493ef94d3e88a366675f21a66757eeefbfb6b13 /etc/completions | |
parent | a12e29b8f37c7f2912b9a333cbffea29ae667fea (diff) |
pkill completion: Don't use cut
Diffstat (limited to 'etc/completions')
-rw-r--r-- | etc/completions/_pkill | 7 |
1 files 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 <derf@derf.homelinux.org> ## 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 |