This is the mail archive of the
mailing list for the Cygwin project.
Re: Interrupting program from command line
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Alex Vinokur <alexvn at connect dot to>
- Cc: cygwin at cygwin dot com
- Date: Thu, 26 Jun 2003 16:27:13 -0400 (EDT)
- Subject: Re: Interrupting program from command line
- Reply-to: cygwin at cygwin dot com
On Thu, 26 Jun 2003, Alex Vinokur wrote:
> 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.,
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,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