From: "Johan Sundström" <johsu650@student.liu.se>
To: zsh-workers@sunsite.auc.dk
Subject: killall completion
Date: Thu, 9 Dec 1999 05:35:45 +0100 (MET) [thread overview]
Message-ID: <Pine.GSO.4.02.9912090526340.3056-100000@astmatix.ida.liu.se> (raw)
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 ()
{
if [[ "$(uname)" == "SunOS" ]]; then
reply=($(ps -o comm|sed '1d;s/^-//'|awk -F/ '{print $NF}'|sort|uniq))
else
reply=($(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==0. Comments, improvements and general thoughts
always welcome!
/Johan Sundström (non-subscriber)
next reply other threads:[~1999-12-09 4:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-09 4:35 Johan Sundström [this message]
1999-12-09 23:47 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.02.9912090526340.3056-100000@astmatix.ida.liu.se \
--to=johsu650@student.liu.se \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).