sleep(1): minor markup tweaks

This commit is contained in:
uwe 2023-02-19 10:54:35 +00:00
parent 2821a47d1c
commit a525a2707f
1 changed files with 36 additions and 19 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sleep.1,v 1.27 2019/01/27 17:42:53 wiz Exp $
.\" $NetBSD: sleep.1,v 1.28 2023/02/19 10:54:35 uwe Exp $
.\"
.\" Copyright (c) 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -47,19 +47,24 @@ The
utility suspends execution for a minimum of
.Ar seconds
seconds, then exits.
It is usually used to schedule the execution of other commands (see
It is usually used to schedule the execution of other commands
.Po
see
.Sx EXAMPLES
below).
below
.Pc .
.Pp
Note: The
.Em Note :
The
.Nx
.Nm
command will accept and honor a non-integer number of specified seconds.
Note however, that if the request is for much more than 2.5 hours,
any fractional seconds will be ignored.
Permitting non-integral delays is a non-portable extension,
and its use will decrease the probability that
a shell script will execute properly on another system.
Permitting non-integral delays is a
.Em non-portable
extension, and its use will decrease the probability that a shell
script will execute properly on another system.
.Pp
When the
.Dv SIGINFO
@ -74,7 +79,7 @@ utility exits with one of the following values:
On successful completion, or if the signal
.Dv SIGALRM
was received.
.It Li \&>\&0
.It Li \&>0
An error occurred.
.El
.Sh EXAMPLES
@ -84,10 +89,12 @@ To schedule the execution of a command for 1800 seconds later:
.Pp
This incantation would wait half an hour before
running the script
.Dq command_file .
(See the
.Ar command_file .
.Po
See the
.Xr at 1
utility.)
utility
.Pc .
.Pp
To repeatedly run a command (using
.Xr csh 1 ) :
@ -110,17 +117,27 @@ 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, processing the generated files (*.rawdata)
program as soon as it is finished
.Po
when
.Li zzz.rawdata
is created
.Pc .
The script checks every five minutes for the file
.Li zzz.rawdata .
When the file is found, processing the generated files
.Pq Li *.rawdata
is done courteously by sleeping for 70 seconds in between each
awk job.
.Pp
To wait until a particular time, the following,
with some error checking added, might be used (using
with some error checking added, might be used
.Po
using
.Xr sh 1
on
.Nx ) :
.Nx
.Pc :
.Bd -literal -offset indent
END=$(( $( date -d "$1" +%s ) - START_TIME ))
while [ "${SECONDS}" -lt "${END}" ]
@ -130,7 +147,7 @@ done
.Ed
.Pp
where the argument
.Sq \&$1
.Ql $1
specifies the desired date and time in any format the
.Fl d
option to the
@ -155,11 +172,11 @@ A
utility appeared in
.At v4 .
Processing fractional seconds, and processing the
.Ic seconds
.Ar seconds
argument respecting the current locale, was added in
.Nx 1.3 .
The ability to sleep for extended periods appeared in
.Nx 9 .
.Nx 9.0 .
.Sh BUGS
This
.Nm