sleep - delay for, or until, a time


sleep [ -v ] [ -until ] time


sleep does nothing, for a certain amount of time. That amount of time may be specified in several ways:


The argument time (which must be in hh:mm or hh:mm:ss format) is an absolute time-of-day (as opposed to the usual relative time). sleep delays until that time.
Verbose: print a visible indication (a running countdown) of the time remaining.


Sleep for five seconds:

	sleep 5

Sleep for five minutes:

	sleep 5m

Sleep for one minute and 23 seconds:

	sleep 1:23

Sleep for half a second:

	sleep 0.5

Sleep for a minute and a half:

	sleep 1.5m

Sleep for one minute, 23.45 seconds:

	sleep 1:23.45

Sleep until nine o'clock tonight:

	sleep -until 21:00

Sleep until a quarter of a second past nine o'clock tonight:

	sleep -until 21:00:00.25


The default colon-separated format for relative sleeps is mm:ss, but for absolute (-until) sleeps it's hh:mm, which is irregular and potentially confusing.

If you try to use the -until option to sleep until some time tomorrow (if, for example, at 11:00 at night you invoke ``sleep -until 1:00'', intending about a two-hour sleep) the program instead complains that it can't sleep for a negative time.


This is obviously a reimplementation, with extensions, of the standard sleep(1) command.
See for possible updates.


sleep(3), alarm(2), setitimer(2)


Steve Summit,