Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: kill and pid files





On Sat, 21 Jun 1997, Zoltan Hidvegi wrote:

> 
> 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
> }


Yes but what if there are TWO processes running with the name 'foo'?

I want to be able to kill them both with one

kill -9 `pid foo`

But this may be a different in what we are calling using 'ps' 

TjL




Messages sorted by: Reverse Date, Date, Thread, Author