isposix

Un outil pour savoir si une commande est posix - retour accueil

git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |

sleep.html (9571B)


      1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved -->
      2 <!DOCTYPE HTML>
      3 <html lang="en">
      4 <head>
      5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0">
      6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 -->
      8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved -->
      9 <title>sleep</title>
     10 </head>
     11 <body bgcolor="white">
     12 <div class="NAVHEADER">
     13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
     14 <tr class="nav">
     15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/sh.html" accesskey="P">&lt;&lt;&lt;
     16 Previous</a></td>
     17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
     18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/sort.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
     19 </tr>
     20 </table>
     21 <hr align="left" width="100%"></div>
     22 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3">
     23 <center><font size="2">The Open Group Base Specifications Issue 8<br>
     24 IEEE Std 1003.1-2024<br>
     25 Copyright © 2001-2024 The IEEE and The Open Group</font></center>
     26 <hr size="2" noshade>
     27 <a name="top" id="top"></a> <a name="sleep" id="sleep"></a> <a name="tag_20_111" id="tag_20_111"></a><!-- sleep -->
     28 <h4 class="mansect"><a name="tag_20_111_01" id="tag_20_111_01"></a>NAME</h4>
     29 <blockquote>sleep — suspend execution for an interval</blockquote>
     30 <h4 class="mansect"><a name="tag_20_111_02" id="tag_20_111_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <p><code><tt>sleep</tt> <i>time</i></code></p>
     33 </blockquote>
     34 <h4 class="mansect"><a name="tag_20_111_03" id="tag_20_111_03"></a>DESCRIPTION</h4>
     35 <blockquote>
     36 <p>The <i>sleep</i> utility shall suspend execution for at least the integral number of seconds specified by the <i>time</i>
     37 operand.</p>
     38 </blockquote>
     39 <h4 class="mansect"><a name="tag_20_111_04" id="tag_20_111_04"></a>OPTIONS</h4>
     40 <blockquote>
     41 <p>None.</p>
     42 </blockquote>
     43 <h4 class="mansect"><a name="tag_20_111_05" id="tag_20_111_05"></a>OPERANDS</h4>
     44 <blockquote>
     45 <p>The following operand shall be supported:</p>
     46 <dl compact>
     47 <dd></dd>
     48 <dt><i>time</i></dt>
     49 <dd>A non-negative decimal integer specifying the number of seconds for which to suspend execution.</dd>
     50 </dl>
     51 </blockquote>
     52 <h4 class="mansect"><a name="tag_20_111_06" id="tag_20_111_06"></a>STDIN</h4>
     53 <blockquote>
     54 <p>Not used.</p>
     55 </blockquote>
     56 <h4 class="mansect"><a name="tag_20_111_07" id="tag_20_111_07"></a>INPUT FILES</h4>
     57 <blockquote>
     58 <p>None.</p>
     59 </blockquote>
     60 <h4 class="mansect"><a name="tag_20_111_08" id="tag_20_111_08"></a>ENVIRONMENT VARIABLES</h4>
     61 <blockquote>
     62 <p>The following environment variables shall affect the execution of <i>sleep</i>:</p>
     63 <dl compact>
     64 <dd></dd>
     65 <dt><i>LANG</i></dt>
     66 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
     67 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
     68 variables used to determine the values of locale categories.)</dd>
     69 <dt><i>LC_ALL</i></dt>
     70 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
     71 <dt><i>LC_CTYPE</i></dt>
     72 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
     73 opposed to multi-byte characters in arguments).</dd>
     74 <dt><i>LC_MESSAGES</i></dt>
     75 <dd><br>
     76 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
     77 <dt><i>NLSPATH</i></dt>
     78 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     79 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
     80 "0"></dd>
     81 </dl>
     82 </blockquote>
     83 <h4 class="mansect"><a name="tag_20_111_09" id="tag_20_111_09"></a>ASYNCHRONOUS EVENTS</h4>
     84 <blockquote>
     85 <p>If the <i>sleep</i> utility receives a SIGALRM signal, one of the following actions shall be taken:</p>
     86 <ol>
     87 <li>
     88 <p>Terminate normally with a zero exit status.</p>
     89 </li>
     90 <li>
     91 <p>Effectively ignore the signal.</p>
     92 </li>
     93 <li>
     94 <p>Provide the default behavior for signals described in the ASYNCHRONOUS EVENTS section of <a href=
     95 "../utilities/V3_chap01.html#tag_18_04"><i>1.4 Utility Description Defaults</i></a> . This could include terminating with a
     96 non-zero exit status.</p>
     97 </li>
     98 </ol>
     99 <p>The <i>sleep</i> utility shall take the standard action for all other signals.</p>
    100 </blockquote>
    101 <h4 class="mansect"><a name="tag_20_111_10" id="tag_20_111_10"></a>STDOUT</h4>
    102 <blockquote>
    103 <p>Not used.</p>
    104 </blockquote>
    105 <h4 class="mansect"><a name="tag_20_111_11" id="tag_20_111_11"></a>STDERR</h4>
    106 <blockquote>
    107 <p>The standard error shall be used only for diagnostic messages.</p>
    108 </blockquote>
    109 <h4 class="mansect"><a name="tag_20_111_12" id="tag_20_111_12"></a>OUTPUT FILES</h4>
    110 <blockquote>
    111 <p>None.</p>
    112 </blockquote>
    113 <h4 class="mansect"><a name="tag_20_111_13" id="tag_20_111_13"></a>EXTENDED DESCRIPTION</h4>
    114 <blockquote>
    115 <p>None.</p>
    116 </blockquote>
    117 <h4 class="mansect"><a name="tag_20_111_14" id="tag_20_111_14"></a>EXIT STATUS</h4>
    118 <blockquote>
    119 <p>The following exit values shall be returned:</p>
    120 <dl compact>
    121 <dd></dd>
    122 <dt>&nbsp;0</dt>
    123 <dd>The execution was successfully suspended for at least <i>time</i> seconds, or a SIGALRM signal was received. See the
    124 ASYNCHRONOUS EVENTS section.</dd>
    125 <dt>&gt;0</dt>
    126 <dd>An error occurred.</dd>
    127 </dl>
    128 </blockquote>
    129 <h4 class="mansect"><a name="tag_20_111_15" id="tag_20_111_15"></a>CONSEQUENCES OF ERRORS</h4>
    130 <blockquote>
    131 <p>Default.</p>
    132 </blockquote>
    133 <hr>
    134 <div class="box"><em>The following sections are informative.</em></div>
    135 <h4 class="mansect"><a name="tag_20_111_16" id="tag_20_111_16"></a>APPLICATION USAGE</h4>
    136 <blockquote>
    137 <p>None.</p>
    138 </blockquote>
    139 <h4 class="mansect"><a name="tag_20_111_17" id="tag_20_111_17"></a>EXAMPLES</h4>
    140 <blockquote>
    141 <p>The <i>sleep</i> utility can be used to execute a command after a certain amount of time, as in:</p>
    142 <pre>
    143 <tt>(sleep 105; </tt><i>command</i><tt>) &
    144 </tt></pre>
    145 <p>or to execute a command every so often, as in:</p>
    146 <pre>
    147 <tt>while true
    148 do
    149     </tt><i>command</i><tt>
    150     sleep 37
    151 done
    152 </tt></pre></blockquote>
    153 <h4 class="mansect"><a name="tag_20_111_18" id="tag_20_111_18"></a>RATIONALE</h4>
    154 <blockquote>
    155 <p>The exit status is allowed to be zero when <i>sleep</i> is interrupted by the SIGALRM signal because most implementations of
    156 this utility rely on the arrival of that signal to notify them that the requested finishing time has been successfully attained.
    157 Such implementations thus do not distinguish this situation from the successful completion case. Other implementations are allowed
    158 to catch the signal and go back to sleep until the requested time expires or to provide the normal signal termination
    159 procedures.</p>
    160 <p>As with all other utilities that take integral operands and do not specify subranges of allowed values, <i>sleep</i> is required
    161 by this volume of POSIX.1-2024 to deal with <i>time</i> requests of up to 2147483647 seconds. This may mean that some
    162 implementations have to make multiple calls to the delay mechanism of the underlying operating system if its argument range is less
    163 than this.</p>
    164 </blockquote>
    165 <h4 class="mansect"><a name="tag_20_111_19" id="tag_20_111_19"></a>FUTURE DIRECTIONS</h4>
    166 <blockquote>
    167 <p>None.</p>
    168 </blockquote>
    169 <h4 class="mansect"><a name="tag_20_111_20" id="tag_20_111_20"></a>SEE ALSO</h4>
    170 <blockquote>
    171 <p><a href="../utilities/wait.html#tag_20_147"><i>wait</i></a></p>
    172 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a></p>
    173 <p>XSH <a href="../functions/alarm.html#"><i>alarm</i></a> , <a href="../functions/sleep.html#tag_17_562"><i>sleep</i></a></p>
    174 </blockquote>
    175 <h4 class="mansect"><a name="tag_20_111_21" id="tag_20_111_21"></a>CHANGE HISTORY</h4>
    176 <blockquote>
    177 <p>First released in Issue 2.</p>
    178 </blockquote>
    179 <h4 class="mansect"><a name="tag_20_111_22" id="tag_20_111_22"></a>Issue 8</h4>
    180 <blockquote>
    181 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    182 </blockquote>
    183 <div class="box"><em>End of informative text.</em></div>
    184 <hr>
    185 <p>&nbsp;</p>
    186 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    187 <hr size="2" noshade>
    188 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    189 POSIX™ is a Trademark of The IEEE.<br>
    190 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    191 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    192 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    193 ]</font></center>
    194 <hr size="2" noshade>
    195 <div class="NAVHEADER">
    196 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    197 <tr class="nav">
    198 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/sh.html" accesskey="P">&lt;&lt;&lt;
    199 Previous</a></td>
    200 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    201 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/sort.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    202 </tr>
    203 </table>
    204 <hr align="left" width="100%"></div>
    205 </body>
    206 </html>