SLEEP(1) General Commands Manual SLEEP(1)
sleep - suspend execution for an interval of time
The sleep utility suspends execution for a minimum of the specified
number of seconds. This number must be positive and may contain a
decimal fraction. sleep is commonly used to schedule the execution of
other commands (see below).
SIGALRM Terminate normally, with a zero exit status.
The sleep utility exits 0 on success, and >0 if an error occurs.
Wait a half hour before running the script command_file (see also the
(sleep 1800; sh command_file >& errors)&
To repetitively run a command (with csh(1)):
while (! -r zzz.rawdata)
foreach i (*.rawdata)
awk -f collapse_data $i >> results
The scenario for such a script might be: a program currently running is
taking longer than expected to process a series of files, and it would be
nice to have another program start processing the files created by the
first program as soon as it is finished (when zzz.rawdata is created).
The script checks every five minutes for this file. When it is found,
processing is done in several steps by sleeping 70 seconds between each
To monitor the growth of a file without consuming too many resources:
while true; do
ls -l file
The sleep utility is compliant with the IEEE Std 1003.1-2008 ("POSIX.1")
The handling of fractional arguments is provided as an extension to that
A sleep utility appeared in Version 4 AT&T UNIX.
OpenBSD 6.2 August 16, 2016 OpenBSD 6.2
[Unix Hosting |
[Engineering & Automation |
Software Development |