This is the mail archive of the
mailing list for the Cygwin project.
Re: How do I kill a grandchild process from shell program?
Lev Bishop wrote:
On 10/23/06, Jim Seymour <firstname.lastname@example.org> wrote:
However, if things don't work fine, the background process sticks around
to plague me later.
I'd like to end my main script by killing the background process (if
it's still around), but I'm having a helluva time figuring out HOW.
$ killall <progname>
Thanks for the reply. Unfortunately, "killall" is not part of my Cygwin
installation - and I don't see which package contains it.
However, I may have solved my problem with this lovely mess:
kill `ps | grep ocdremote | tr -s " " | cut -f2 -d " "`
The first "kill" stops the background bash process. The second stops
the utility in question. Not as elegant as I'd hoped, but it seems to
do the trick.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html