From: Zoltan Hidvegi <hzoli@ny.frontiercomm.net>
To: luomat@peak.org
Cc: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: Re: kill and pid files
Date: Sat, 21 Jun 1997 12:37:12 -0400 (EDT) [thread overview]
Message-ID: <199706211637.MAA00840@hzoli.home> (raw)
In-Reply-To: <199706211508.LAA08120@kira.peak.org> from "Timothy J. Luoma" at "Jun 21, 97 11:07:53 am"
Timothy J. Luoma wrote:
> Zoltan Hidvegi <hzoli@ny.frontiercomm.net> wrote in
[...]
> > Oh, this is a really overcomplicated solution for a simple problem. How
> > about this:
> >
> > pid () {
> > local i
> > for i
> > do
> > ps acx | sed -n "s/ *\([0-9]*\) .* $i *\$/\1/p"
> > done
> > }
>
> Yes but what if there is more than one process by that name?
>
> I usually want to kill them all. This just kills one of them, whereas my
> solution kills them all (that's what the 'tr' part is for).... however, it
[...]
> it also takes multiple arguments, in case you need to kill several things at once
Did you try my script? kill -TERM `pid foo bar baz` will kill all foo, bar,
baz named processes. And of course it can be improved, since sed is not
necessary:
pid () {
setopt localoptions extendedglob
local i
for i
do
echo "${(M)${(M)${(f)$(ps acx)}:%* $i #}## #<->}"
done
}
-- End of PGP signed section, PGP failed!
Where can I find your PGP key? I tried finger -l, your web page and the
key servers with no luck.
Zoltan
next parent reply other threads:[~1997-06-21 16:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199706211508.LAA08120@kira.peak.org>
1997-06-21 16:37 ` Zoltan Hidvegi [this message]
1997-06-21 18:39 ` Timothy Luoma
1997-06-21 18:46 ` Zoltan Hidvegi
1997-06-22 4:06 ` Geoff Wing
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=199706211637.MAA00840@hzoli.home \
--to=hzoli@ny.frontiercomm.net \
--cc=luomat@peak.org \
--cc=zsh-workers@math.gatech.edu \
/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).