This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Interrupting program from command line


On Thu, 26 Jun 2003, Alex Vinokur wrote:

> Hi,
>
> I have some program that works endlessly.
> I want the program to be interrupted in some time after starting.
> Is it possible to do that from command?
>
> Something like (pseudo-code) :
> $ run 6 sec my_program,
>
>    Alex Vinokur

Sure.  Write a script that saves the PID, starts a timer, and kills the
child on timeout (you'll need to clean up the timer if the child finishes
earlier).  Or take advantage of a script that's already written, e.g.,
<http://www-124.ibm.com/developerworks/oss/cvs/jikesrvm/rvm/regression/limited.sh?rev=1.5>.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]