isposix

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

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

batch.html (13945B)


      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>batch</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/basename.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/bc.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="batch" id="batch"></a> <a name="tag_20_08" id="tag_20_08"></a><!-- batch -->
     28 <h4 class="mansect"><a name="tag_20_08_01" id="tag_20_08_01"></a>NAME</h4>
     29 <blockquote>batch — schedule commands to be executed in a batch queue</blockquote>
     30 <h4 class="mansect"><a name="tag_20_08_02" id="tag_20_08_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <p><i>batch</i></code></p>
     33 </blockquote>
     34 <h4 class="mansect"><a name="tag_20_08_03" id="tag_20_08_03"></a>DESCRIPTION</h4>
     35 <blockquote>
     36 <p>The <i>batch</i> utility shall read commands from standard input and schedule them for execution in a batch queue. It shall be
     37 the equivalent of the command:</p>
     38 <pre>
     39 <tt>at -q b -m now
     40 </tt></pre>
     41 <p>where queue <i>b</i> is a special <a href="../utilities/at.html"><i>at</i></a> queue, specifically for batch jobs. Batch jobs
     42 shall be submitted to the batch queue with no time constraints and shall be run by the system using algorithms, based on
     43 unspecified factors, that may vary with each invocation of <i>batch</i>.</p>
     44 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     45 Users shall be permitted to use <i>batch</i> if their name appears in the file <b>at.allow</b> which is located in an
     46 implementation-defined directory. If that file does not exist, the file <b>at.deny</b>, which is located in an
     47 implementation-defined directory, shall be checked to determine whether the user shall be denied access to <i>batch</i>. If neither
     48 file exists, only a process with appropriate privileges shall be allowed to submit a job. If only <b>at.deny</b> exists and is
     49 empty, global usage shall be permitted. The <b>at.allow</b> and <b>at.deny</b> files shall consist of one user name per line.
     50 <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
     51 </blockquote>
     52 <h4 class="mansect"><a name="tag_20_08_04" id="tag_20_08_04"></a>OPTIONS</h4>
     53 <blockquote>
     54 <p>None.</p>
     55 </blockquote>
     56 <h4 class="mansect"><a name="tag_20_08_05" id="tag_20_08_05"></a>OPERANDS</h4>
     57 <blockquote>
     58 <p>None.</p>
     59 </blockquote>
     60 <h4 class="mansect"><a name="tag_20_08_06" id="tag_20_08_06"></a>STDIN</h4>
     61 <blockquote>
     62 <p>The standard input shall be a text file consisting of commands acceptable to the shell command language described in <a href=
     63 "../utilities/V3_chap02.html#tag_19"><i>2. Shell Command Language</i></a> .</p>
     64 </blockquote>
     65 <h4 class="mansect"><a name="tag_20_08_07" id="tag_20_08_07"></a>INPUT FILES</h4>
     66 <blockquote>
     67 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     68 The text files <b>at.allow</b> and <b>at.deny</b>, which are located in an implementation-defined directory, shall contain zero or
     69 more user names, one per line, of users who are, respectively, authorized or denied access to the <a href=
     70 "../utilities/at.html"><i>at</i></a> and <i>batch</i> utilities. <img src="../images/opt-end.gif" alt="[Option End]" border=
     71 "0"></p>
     72 </blockquote>
     73 <h4 class="mansect"><a name="tag_20_08_08" id="tag_20_08_08"></a>ENVIRONMENT VARIABLES</h4>
     74 <blockquote>
     75 <p>The following environment variables shall affect the execution of <i>batch</i>:</p>
     76 <dl compact>
     77 <dd></dd>
     78 <dt><i>LANG</i></dt>
     79 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
     80 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
     81 variables used to determine the values of locale categories.)</dd>
     82 <dt><i>LC_ALL</i></dt>
     83 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
     84 <dt><i>LC_CTYPE</i></dt>
     85 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
     86 opposed to multi-byte characters in arguments and input files).</dd>
     87 <dt><i>LC_MESSAGES</i></dt>
     88 <dd><br>
     89 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and
     90 informative messages written to standard output.</dd>
     91 <dt><i>LC_TIME</i></dt>
     92 <dd>Determine the format and contents for date and time strings written by <i>batch</i>.</dd>
     93 <dt><i>NLSPATH</i></dt>
     94 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     95 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
     96 "0"></dd>
     97 <dt><i>SHELL</i></dt>
     98 <dd>Determine the name of a command interpreter to be used to invoke the at-job. If the variable is unset or null, <a href=
     99 "../utilities/sh.html"><i>sh</i></a> shall be used. If it is set to a value other than a name for <a href=
    100 "../utilities/sh.html"><i>sh</i></a>, the implementation shall do one of the following: use that shell; use <a href=
    101 "../utilities/sh.html"><i>sh</i></a>; use the login shell from the user database; any of the preceding accompanied by a warning
    102 diagnostic about which was chosen.</dd>
    103 <dt><i>TZ</i></dt>
    104 <dd>Determine the timezone. The job shall be submitted for execution at the time specified by <i>timespec</i> or <b>-t</b>
    105 <i>time</i> relative to the timezone specified by the <i>TZ</i> variable. If <i>timespec</i> specifies a timezone, it overrides
    106 <i>TZ .</i> If <i>timespec</i> does not specify a timezone and <i>TZ</i> is unset or null, an unspecified default timezone shall be
    107 used.</dd>
    108 </dl>
    109 </blockquote>
    110 <h4 class="mansect"><a name="tag_20_08_09" id="tag_20_08_09"></a>ASYNCHRONOUS EVENTS</h4>
    111 <blockquote>
    112 <p>Default.</p>
    113 </blockquote>
    114 <h4 class="mansect"><a name="tag_20_08_10" id="tag_20_08_10"></a>STDOUT</h4>
    115 <blockquote>
    116 <p>When standard input is a terminal, prompts of unspecified format for each line of the user input described in the STDIN section
    117 may be written to standard output.</p>
    118 </blockquote>
    119 <h4 class="mansect"><a name="tag_20_08_11" id="tag_20_08_11"></a>STDERR</h4>
    120 <blockquote>
    121 <p>The following shall be written to standard error when a job has been successfully submitted:</p>
    122 <pre>
    123 <tt>"job %s at %s\n", </tt><i>at_job_id</i><tt>, &lt;</tt><i>date</i><tt>&gt;
    124 </tt></pre>
    125 <p>where <i>date</i> shall be equivalent in format to the output of:</p>
    126 <pre>
    127 <tt>date +"%a %b %e %T %Y"
    128 </tt></pre>
    129 <p>The date and time written shall be adjusted so that they appear in the timezone of the user (as determined by the <i>TZ</i>
    130 variable).</p>
    131 <p>Neither this, nor warning messages concerning the selection of the command interpreter, are considered a diagnostic that changes
    132 the exit status.</p>
    133 <p>Diagnostic messages, if any, shall be written to standard error.</p>
    134 </blockquote>
    135 <h4 class="mansect"><a name="tag_20_08_12" id="tag_20_08_12"></a>OUTPUT FILES</h4>
    136 <blockquote>
    137 <p>None.</p>
    138 </blockquote>
    139 <h4 class="mansect"><a name="tag_20_08_13" id="tag_20_08_13"></a>EXTENDED DESCRIPTION</h4>
    140 <blockquote>
    141 <p>None.</p>
    142 </blockquote>
    143 <h4 class="mansect"><a name="tag_20_08_14" id="tag_20_08_14"></a>EXIT STATUS</h4>
    144 <blockquote>
    145 <p>The following exit values shall be returned:</p>
    146 <dl compact>
    147 <dd></dd>
    148 <dt>&nbsp;0</dt>
    149 <dd>Successful completion.</dd>
    150 <dt>&gt;0</dt>
    151 <dd>An error occurred.</dd>
    152 </dl>
    153 </blockquote>
    154 <h4 class="mansect"><a name="tag_20_08_15" id="tag_20_08_15"></a>CONSEQUENCES OF ERRORS</h4>
    155 <blockquote>
    156 <p>The job shall not be scheduled.</p>
    157 </blockquote>
    158 <hr>
    159 <div class="box"><em>The following sections are informative.</em></div>
    160 <h4 class="mansect"><a name="tag_20_08_16" id="tag_20_08_16"></a>APPLICATION USAGE</h4>
    161 <blockquote>
    162 <p>It may be useful to redirect standard output within the specified commands.</p>
    163 </blockquote>
    164 <h4 class="mansect"><a name="tag_20_08_17" id="tag_20_08_17"></a>EXAMPLES</h4>
    165 <blockquote>
    166 <ol>
    167 <li>
    168 <p>This sequence can be used at a terminal:</p>
    169 <pre>
    170 <tt>batch
    171 sort &lt; file &gt;outfile
    172 EOT
    173 </tt></pre></li>
    174 <li>
    175 <p>This sequence, which demonstrates redirecting standard error to a pipe, is useful in a command procedure (the sequence of output
    176 redirection specifications is significant):</p>
    177 <pre>
    178 <tt>batch &lt;&lt;!
    179 diff file1 file2 2&gt;&amp;1 &gt;outfile | mailx -s "outfile update" mygroup
    180 !
    181 </tt></pre>
    182 <p>Note that this always sends mail when there has been an attempt to update <b>outfile</b> and the body of the message will be
    183 empty unless an error occurred.</p>
    184 </li>
    185 <li>
    186 <p>The following shows how to capture both standard error and standard output:</p>
    187 <pre>
    188 <tt>batch &lt;&lt;EOF
    189 {
    190     run-batch-processing |
    191         mailx -s "batch processing output" mygroup
    192 } 2&gt;&amp;1 | mailx -E -s "errors during batch processing" mygroup
    193 EOF
    194 </tt></pre></li>
    195 </ol>
    196 </blockquote>
    197 <h4 class="mansect"><a name="tag_20_08_18" id="tag_20_08_18"></a>RATIONALE</h4>
    198 <blockquote>
    199 <p>Early proposals described <i>batch</i> in a manner totally separated from <a href="../utilities/at.html"><i>at</i></a>, even
    200 though the historical model treated it almost as a synonym for <a href="../utilities/at.html"><i>at</i></a> <b>-qb</b>. A number of
    201 features were added to list and control batch work separately from those in <a href="../utilities/at.html"><i>at</i></a>. Upon
    202 further reflection, it was decided that the benefit of this did not merit the change to the historical interface.</p>
    203 <p>The <b>-m</b> option was included on the equivalent <a href="../utilities/at.html"><i>at</i></a> command because it is
    204 historical practice to mail results to the submitter, even if all job-produced output is redirected. As explained in the RATIONALE
    205 for <a href="../utilities/at.html"><i>at</i></a>, the <b>now</b> keyword submits the job for immediate execution (after scheduling
    206 delays), despite some historical systems where <a href="../utilities/at.html"><i>at</i></a> <b>now</b> would have been considered
    207 an error.</p>
    208 </blockquote>
    209 <h4 class="mansect"><a name="tag_20_08_19" id="tag_20_08_19"></a>FUTURE DIRECTIONS</h4>
    210 <blockquote>
    211 <p>None.</p>
    212 </blockquote>
    213 <h4 class="mansect"><a name="tag_20_08_20" id="tag_20_08_20"></a>SEE ALSO</h4>
    214 <blockquote>
    215 <p><a href="../utilities/at.html#"><i>at</i></a></p>
    216 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a></p>
    217 </blockquote>
    218 <h4 class="mansect"><a name="tag_20_08_21" id="tag_20_08_21"></a>CHANGE HISTORY</h4>
    219 <blockquote>
    220 <p>First released in Issue 2.</p>
    221 </blockquote>
    222 <h4 class="mansect"><a name="tag_20_08_22" id="tag_20_08_22"></a>Issue 6</h4>
    223 <blockquote>
    224 <p>This utility is marked as part of the User Portability Utilities option.</p>
    225 <p>The NAME is changed to align with the IEEE&nbsp;P1003.2b draft standard.</p>
    226 <p>The normative text is reworded to avoid use of the term &quot;must&quot; for application requirements.</p>
    227 </blockquote>
    228 <h4 class="mansect"><a name="tag_20_08_23" id="tag_20_08_23"></a>Issue 7</h4>
    229 <blockquote>
    230 <p>The <i>batch</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an
    231 option for interactive utilities.</p>
    232 <p>SD5-XCU-ERN-95 is applied, removing the references to fixed locations for the files referenced by the <i>batch</i> utility.</p>
    233 </blockquote>
    234 <h4 class="mansect"><a name="tag_20_08_24" id="tag_20_08_24"></a>Issue 8</h4>
    235 <blockquote>
    236 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    237 <p>Austin Group Defect 1368 is applied, changing the EXAMPLES section.</p>
    238 </blockquote>
    239 <div class="box"><em>End of informative text.</em></div>
    240 <hr>
    241 <p>&nbsp;</p>
    242 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    243 <hr size="2" noshade>
    244 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    245 POSIX™ is a Trademark of The IEEE.<br>
    246 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    247 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    248 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    249 ]</font></center>
    250 <hr size="2" noshade>
    251 <div class="NAVHEADER">
    252 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    253 <tr class="nav">
    254 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/basename.html" accesskey="P">&lt;&lt;&lt;
    255 Previous</a></td>
    256 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    257 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/bc.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    258 </tr>
    259 </table>
    260 <hr align="left" width="100%"></div>
    261 </body>
    262 </html>