A challenge (was Re: Of course, they'll deny it.)

George Toft plug-discuss@lists.PLUG.phoenix.az.us
Fri, 21 Sep 2001 18:21:24 -0700


Your test won't work.  The corewar script is an infinite loop,
and therefore won't ever get to the sleep.  I tried this using two
logins - I ran corewar in one, then ran killwar in the other.  
The corwar processes spawn too fast.

George


"John (EBo) David" wrote:
> 
> Thomas Mondoshawan Tate wrote:
> >
> > >   Well, if I *know* the name of the program causing the evil behaviour
> > > then I can write a awk/perl/sh script that parses the info from a 'ps'
> > > and then kills them all in turn.  This could also be done
> > > recersively...  The problem though is that the creation loop is likely
> > > faster then the seek-and-destroy-process loop.  So that would not likely
> > > work either unless you nice your kill process to something like a -19.
> >
> > Hrm... How about this (in bash and awk):
> > ---
> > #!/bin/bash
> >
> > RESULT=`ps ax |grep corewar`
> >
> > while $RESULT; do
> >         for i in $RESULT; do
> >                 kill `echo $i |awk '{ $1 }'`
> >         done
> >         RESULT=`ps ax |grep corewar`
> > done
> > ---
> >
> > That should do it. =o)
> 
> don't think so because the creation loop:
> 
> while 1; do
>   `corewar`
>   ... do something
> done
> 
> should run faster than a ps and kill each.  I expect that it will grow
> faster then the kill...  What are you thoughts on this?
> 
> We could test it by setting up two scripts (corewar and killwar) and
> then do a `corewar; sleep 3; killwar`  and see if it dies or lives ;-)
> 
>   EBo --
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
> 
> PLUG-discuss mailing list  -  PLUG-discuss@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss