zsh-workers
 help / color / mirror / code / Atom feed
* Can Zsh do this for me?
@ 2003-09-02 12:08 DervishD
  2003-09-02 12:25 ` Oliver Kiddle
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: DervishD @ 2003-09-02 12:08 UTC (permalink / raw)
  To: Zsh

    Hi all :))

    I'm writing a command to kill a process by name, not by PID, just
like 'pidof' but without using 'pidof' ;))) It's pretty easy using
the ps command and a pipeline. Right know, it can be written like
this:

    ps xh | grep name | tr -s " " | cut -d " " -f 2

    Since it will be called by root to kill root processes, it will
do, and with my ps binary, the options are correct. But I don't want
to start four processes just to get the pid of one of them. I can use
my /proc filesystem, but I was wondering if Zsh has some facility to
get the process ID using the command name, or if I can write the
above pipeline in a shorter form using some Zsh capability.

    BTW, I want to write a 'ps' command on my own because I don't
like the procps one available for Linux, nor the others out there,
and I think that with the zsh/stat module I could do it in a shell
script :)))

    Well, thanks in advance :))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-09-02 19:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-02 12:08 Can Zsh do this for me? DervishD
2003-09-02 12:25 ` Oliver Kiddle
2003-09-02 19:21   ` DervishD
2003-09-02 12:38 ` Alexey Tourbin
2003-09-02 13:07   ` Peter Stephenson
2003-09-02 19:22   ` DervishD
2003-09-02 13:30 ` Jason Price
2003-09-02 19:57   ` DervishD

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).