Re: A nice-like command for making processes sleep from time to time



Wed, 05 Oct 2011 12:51:29 +0200, kax did cat :

Hi, is there some way of launching a command from the shell in such a
way that the process will sleep x seconds every n seconds ? Of course I
am asking wether you can do it from "outside" (not by including it in
your own shell script for instance) a little like with the "nice"
command?

Regards,

If you don't want to use the real supercontroller (with 'nice')
you'll then have to mimic the interrupt/semaphore mechanisms.
Simplest way will be to include in your scripts some access to a
resource you'll control from outside the script, like loop and
wait/(test&set) for the presence of a file/fifo.

If your question concerns scripts to which you don't have
write access on machines to which you don't have 'nice' rights,
hey, wait a minute, freeze! ;D)
.



Relevant Pages

  • Re: Sleep command quitting
    ... It cannot be that the `sleep` command is terminating. ... That script was popular when I started working at SCO Support in 1989. ... it doesn't really hold the settings you specify. ... anything else comes along and makes further changes, the holdopen script ...
    (comp.unix.sco.misc)
  • Re: WScript.dll not working
    ... But, when i call a script indirectly in my application's exe's context, then it doesn't repond further. ... the sleep method is coded into the ... could call the sleep api directly from script. ...
    (microsoft.public.scripting.vbscript)
  • Re: Rename File Using Strring Found in File?
    ... OK, thanks, but the script does not seem to rename the files. ... # sleep 1; ... to the string in this particular file that I want to match. ...
    (comp.lang.perl.misc)
  • my script crashes when I try to rename the file!
    ... OK, thanks, but the script does not seem to rename the files. ... You can set the working directory from within your Perl ... # sleep 1; ... to the string in this particular file that I want to match. ...
    (perl.beginners)
  • More on perl like tail
    ... If I write my script based on this code... ... But first about that sleep comment. ... I see 7-8 lines output to the tail -f slpipe command, ...
    (perl.beginners)