I was wondering if it was possible to manually wake a perl script that has gone to sleep.
Basically I set my script to sleep for say an hour after performing something, and 10 minutes later I realize I want it to run again.
The platform I’m running on is linux, with a tcsh shell.
Again, Thanks for any help
On many systems, system calls like
sleepcan be interrupted with signals. On such an interruption,sleepwill return the number of seconds that it actually slept for and set$!. Of course you have to use a signal that will allow your script to continue. If you haven’t set any specific signal handler, a combination ofSIGSTOPandSIGCONTwill do the trick, too.Example:
Another example (trivial
SIGUSR1handler):