If you had made your command a reasonable length, say less than 15
characters, "mirrormandrake" would do, you could just say:

killall mirrormandrake

you can still kill it by going after the full pathname of the script 
with

fuser -k

fuser is really neat.  Read the man page.

Read man pages at random.  Unix has lots of neat commands.

Lawson
          >< Microsoft free environment

This mail client runs on Wine.  Your mileage may vary.


On Fri, 26 Feb 1999, Dan Browning (Network Admin) wrote:

> I need to be able to kill a parent process based on the child process
name.
> I can use "ps aux | grep xxx" to find the parent parent process ID -
but how
> do I get that number out of that line?  I need to pipe that number to
kill,
> so that the parent is dead and all it's children die.  I tried to pipe
it to
> cut, but I couldn't get it work every time.   Or maybe there is a
command
> that reports the parent of a process?  That would be the handiest.
> 
> Some more background info:
> 
> Thanks to your guys' help, I have a simple script (included below),
that
> just runs a few programs in a loop for me.  But the parent of the
process
> is -bash.  The problem is when I want to stop the mirror program.  Of
course
> I can't just "killall mirror" because the shell will just start another
one
> (because of the loop).  Now, because the parent is bash, then I would
have
> to kill all bash processes (assuming I don't know which bash started my
> "mirror"s) to get the child processes (mirror) to stop.
> 
> Is there a command that will return the name of the parent of a given
> process?  Then I could pipe that to killall.
> 
> Here is the contents of the file newmirrormandrake.sh
> ----------------------------
> M=/home/danb/mirror/mirror.mandrake
> 
> while true
> do
>       mirror -pMandrake       $M
>       mirror -papps           $M
>       mirror -pdoc            $M
>       mirror -pdosutils       $M
>       mirror -pimages                 $M
>       mirror -pmisc           $M
> done
> ----------------------------
> 
> TIA.
> 
> 
> Dan Browning
> Network Administrator
> Cyclone Computer Systems
> 
> 


___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

Reply via email to