Re: Re: command to ensure other command does last longer than5 seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sat, 2007-04-07 at 14:03 -0400, William L. Maltby wrote:
> On Sat, 2007-04-07 at 14:20 -0300, Rodrigo Barbosa wrote:
> <snip>

> > 
> > If I've got your meaning write, you are proposing something like:
> > 
> > ( sleep $TIMER; kill -WHATEVER $PID )&
> > 
> > Which is pretty interesting way to do it, which I haven't though about
> > until now. I never tried (...)&, and after you said this, I decided to
> > see if it worked. And it did. It is a pretty neat way to create
> > alarms inside a shell script.

Almost forgot - you might enjoy looking at the "trap" command in bash
(and other shells). Allows entry to arbitrary routines based on
asynchronous events, similar to signal handling in "C". Receiving
function has the choice of resetting the trap, issuing arbitrary actions
and signals, setting other traps, etc. Fun stuff.

> <snip>

--
Bill

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux