I was wondering if there is a statement which I can use to have a program sleep indefinitely (probably using sleep function??). (I am obviously doing this waiting for a signal that is going to be delivered at some time to this process and it will wake it up)
Linux command — `$ sleep infinity` is for forever sleeping ( never awake until escape )
How to Use the Bash Sleep Command. Sleep is a very versatile command with a very simple syntax. It is as easy as typing sleep N . This will pause your script for N seconds, with N being either a positive integer or a floating point number.
You want pause().
EDIT: The most likely circumstances under which you might want to use pause() will actually cause a race condition, so prefer sigsuspend().
On Unix, see either pause or sigsuspend.
And on Windows use Sleep(INFINITE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With