From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1164 invoked from network); 9 Dec 1999 04:36:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Dec 1999 04:36:36 -0000 Received: (qmail 29964 invoked by alias); 9 Dec 1999 04:35:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8961 Received: (qmail 29957 invoked from network); 9 Dec 1999 04:35:45 -0000 Date: Thu, 9 Dec 1999 05:35:45 +0100 (MET) From: =?ISO-8859-1?Q?Johan_Sundstr=F6m?= X-Sender: johsu650@astmatix.ida.liu.se To: zsh-workers@sunsite.auc.dk Subject: killall completion Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi! Yet another old-style/compctl completion, this time for killall; perhaps worth including in zsh completion archive batch supplied with zsh:s? It's designed for the ps of SunOS 5.7 or the ps shipped with Red Hat Linux (where ps --version says "procps version 1.2.7"). functions complete-killall ()=20 { if [[ "$(uname)" =3D=3D "SunOS" ]]; then reply=3D($(ps -o comm|sed '1d;s/^-//'|awk -F/ '{print $NF}'|sort|uniq= )) else reply=3D($(ps alwww|cut -b72-|egrep -v '^\('|sed '1d;s/^-//;s/ .*//'|= awk -F/ '{print $NF}'|sort|uniq)) fi } compctl -K complete-killall killall Could be improved by somehow filtering out the commands of the pipe chain from the completion namespace, but I couldn't come up with a working scheme within five minutes, so I dropped the idea. :-) Other possible future improvement is a wider process scope (ps -a/-e respectively) if UID=3D=3D0. Comments, improvements and general thoughts always welcome! /Johan Sundstr=F6m (non-subscriber)