Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sleep(1) [freebsd man page]

SLEEP(1)						    BSD General Commands Manual 						  SLEEP(1)

NAME
sleep -- suspend execution for an interval of time SYNOPSIS
sleep seconds DESCRIPTION
The sleep command suspends execution for a minimum of seconds. If the sleep command receives a signal, it takes the standard action. When the SIGINFO signal is received, the estimate of the amount of seconds left to sleep is printed on the standard output. IMPLEMENTATION NOTES
The SIGALRM signal is not handled specially by this implementation. The sleep command allows and honors a non-integer number of seconds to sleep in any form acceptable by strtod(3). This is a non-portable extension, and its use will nearly guarantee that a shell script will not execute properly on another system. EXIT STATUS
The sleep utility exits 0 on success, and >0 if an error occurs. EXAMPLES
To schedule the execution of a command for x number seconds later (with csh(1)): (sleep 1800; sh command_file >& errors)& This incantation would wait a half hour before running the script command_file. (See the at(1) utility.) To reiteratively run a command (with the csh(1)): while (1) if (! -r zzz.rawdata) then sleep 300 else foreach i (`ls *.rawdata`) sleep 70 awk -f collapse_data $i >> results end break endif end The scenario for a script such as this 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 the file zzz.rawdata, when the file is found, then another portion processing is done courteously by sleeping for 70 seconds in between each awk job. SEE ALSO
nanosleep(2), sleep(3) STANDARDS
The sleep command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. HISTORY
A sleep command appeared in Version 4 AT&T UNIX. BSD
April 18, 1994 BSD

Check Out this Related Man Page

sleep(1)							   User Commands							  sleep(1)

NAME
sleep - suspend execution for an interval SYNOPSIS
sleep time DESCRIPTION
The sleep utility will suspend execution for at least the integral number of seconds specified by the time operand. OPERANDS
The following operands are supported: time A non-negative decimal integer specifying the number of seconds for which to suspend execution. EXAMPLES
Example 1: Suspending command execution for a time To execute a command after a certain amount of time: example% (sleep 105; command)& Example 2: Executing a command every so often example% while true do command sleep 37 done ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of sleep: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 The execution was successfully suspended for at least time seconds, or a SIGALRM signal was received (see NOTES). >0 An error has occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
wait(1), alarm(2), sleep(3C), wait(3UCB), attributes(5), environ(5), standards(5) NOTES
If the sleep utility receives a SIGALRM signal, one of the following actions will be taken: o Terminate normally with a zero exit status. o Effectively ignore the signal. The sleep utility will take the standard action for all other signals. SunOS 5.10 1 Feb 1995 sleep(1)
Man Page