*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> sleep (1)              
Title
Content
Arch
Section
 

SLEEP(1)

Contents


NAME    [Toc]    [Back]

     sleep - suspend execution for an interval of time

SYNOPSIS    [Toc]    [Back]

     sleep seconds

DESCRIPTION    [Toc]    [Back]

     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).

EXAMPLES    [Toc]    [Back]

     Wait a half hour before running the script command_file (see
also the
     at(1) utility):

           (sleep 1800; sh command_file >& errors)&

     To repetitively run a command (with csh(1)):

           while (! -r zzz.rawdata)
                   sleep 300
           end
           foreach i (*.rawdata)
                   sleep 70
                   awk -f collapse_data $i >> results
           end

     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
     awk(1) job.

     To monitor the growth of a file without consuming  too  many
resources:

           while true; do
                   ls -l file
                   sleep 5
           done

DIAGNOSTICS    [Toc]    [Back]

     The sleep utility exits with one of the following values:

     0     On successful completion, or if the signal SIGALRM was
received.
     >0    An error occurred.

SEE ALSO    [Toc]    [Back]

      
      
     at(1),  nanosleep(2),  setitimer(2),   alarm(3),   sleep(3),
usleep(3)

STANDARDS    [Toc]    [Back]

     The  sleep  command  offers  a  superset  of IEEE Std 1003.2
(``POSIX.2'')
     functionality.  The handling of fractional arguments is provided as an
     extension to the specification.

OpenBSD      3.6                          April      18,     1994
[ Back ]
 Similar pages
Name OS Title
usleep HP-UX suspend execution for an interval
sleep IRIX suspend execution for interval
usleep IRIX suspend execution for an interval
sleep IRIX suspend execution for an interval
sleep HP-UX suspend execution for an interval
usleep NetBSD suspend execution for interval of microseconds
usleep OpenBSD suspend execution for interval of microseconds
sleep OpenBSD suspend process execution for interval of seconds
sleep NetBSD suspend process execution for interval of seconds
usleep FreeBSD suspend process execution for an interval measured in microseconds
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service