isposix

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

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

at.html (30583B)


      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>at</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/asa.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/awk.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="at" id="at"></a> <a name="tag_20_05" id="tag_20_05"></a><!-- at -->
     28 <h4 class="mansect"><a name="tag_20_05_01" id="tag_20_05_01"></a>NAME</h4>
     29 <blockquote>at — execute commands at a later time</blockquote>
     30 <h4 class="mansect"><a name="tag_20_05_02" id="tag_20_05_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <p><code><tt>at</tt> <b>[</b><tt>-m</tt><b>] [</b><tt>-f</tt> <i>file</i><b>] [</b><tt>-q</tt> <i>queuename</i><b>]</b> <tt>-t</tt>
     33 <i>time_arg</i> <tt><br>
     34 <br>
     35 at</tt> <b>[</b><tt>-m</tt><b>] [</b><tt>-f</tt> <i>file</i><b>] [</b><tt>-q</tt> <i>queuename</i><b>]</b>
     36 <i>timespec</i><tt>...<br>
     37 <br>
     38 at -r</tt> <i>at_job_id</i><tt>...<br>
     39 <br>
     40 at -l -q</tt> <i>queuename</i> <tt><br>
     41 <br>
     42 at -l</tt> <b>[</b><i>at_job_id</i><tt>...</tt><b>]</b> <tt><br></tt></code></p>
     43 </blockquote>
     44 <h4 class="mansect"><a name="tag_20_05_03" id="tag_20_05_03"></a>DESCRIPTION</h4>
     45 <blockquote>
     46 <p>The <i>at</i> utility shall read commands from standard input and group them together as an <i>at-job</i>, to be executed at a
     47 later time.</p>
     48 <p>The at-job shall be executed in a separate invocation of the shell, running in a separate process group with no controlling
     49 terminal, except that the environment variables, current working directory, file creation mask, and other implementation-defined
     50 execution-time attributes in effect when the <i>at</i> utility is executed shall be retained and used when the at-job is
     51 executed.</p>
     52 <p>When the at-job is submitted, the <i>at_job_id</i> and scheduled time shall be written to standard error. The <i>at_job_id</i>
     53 is an identifier that shall be a string consisting solely of alphanumeric characters and the &lt;period&gt; character. The
     54 <i>at_job_id</i> shall be assigned by the system when the job is scheduled such that it uniquely identifies a particular job.</p>
     55 <p>User notification and the processing of the job's standard output and standard error are described under the <b>-m</b>
     56 option.</p>
     57 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     58 Users shall be permitted to use <i>at</i> if their name appears in the file <b>at.allow</b> which is located in an
     59 implementation-defined directory. If that file does not exist, the file <b>at.deny</b>, which is located in an
     60 implementation-defined directory, shall be checked to determine whether the user shall be denied access to <i>at</i>. If neither
     61 file exists, only a process with appropriate privileges shall be allowed to submit a job. If only <b>at.deny</b> exists and is
     62 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.
     63 <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
     64 </blockquote>
     65 <h4 class="mansect"><a name="tag_20_05_04" id="tag_20_05_04"></a>OPTIONS</h4>
     66 <blockquote>
     67 <p>The <i>at</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     68 Guidelines</i></a> .</p>
     69 <p>The following options shall be supported:</p>
     70 <dl compact>
     71 <dd></dd>
     72 <dt><b>-f&nbsp;</b><i>file</i></dt>
     73 <dd>Specify the pathname of a file to be used as the source of the at-job, instead of standard input.</dd>
     74 <dt><b>-l</b></dt>
     75 <dd>(The letter ell.) Report all jobs scheduled for the invoking user if no <i>at_job_id</i> operands are specified. If
     76 <i>at_job_id</i>s are specified, report only information for these jobs. The output shall be written to standard output.</dd>
     77 <dt><b>-m</b></dt>
     78 <dd>Send mail to the invoking user after the at-job has run, announcing its completion. Standard output and standard error produced
     79 by the at-job shall be mailed to the user as well, unless redirected elsewhere. Mail shall be sent even if the job produces no
     80 output.
     81 <p>If <b>-m</b> is not used, the job's standard output and standard error shall be provided to the user by means of mail, unless
     82 they are redirected elsewhere; if there is no such output to provide, the implementation need not notify the user of the job's
     83 completion.</p>
     84 </dd>
     85 <dt><b>-q&nbsp;</b><i>queuename</i></dt>
     86 <dd><br>
     87 Specify in which queue to schedule a job for submission. When used with the <b>-l</b> option, limit the search to that particular
     88 queue. By default, at-jobs shall be scheduled in queue <i>a</i>. In contrast, queue <i>b</i> shall be reserved for batch jobs; see
     89 <a href="../utilities/batch.html"><i>batch</i></a>. The meanings of all other <i>queuename</i>s are implementation-defined. If
     90 <b>-q</b> <i>b</i> is specified along with either of the <b>-t</b> <i>time_arg</i> or <i>timespec</i> arguments, the results are
     91 unspecified.</dd>
     92 <dt><b>-r</b></dt>
     93 <dd>Remove the jobs with the specified <i>at_job_id</i> operands that were previously scheduled by the <i>at</i> utility.</dd>
     94 <dt><b>-t&nbsp;</b><i>time_arg</i></dt>
     95 <dd>Submit the job to be run at the time specified by the <i>time</i> option-argument, which the application shall ensure has the
     96 format as specified by the <a href="../utilities/touch.html"><i>touch</i></a> <b>-t</b> <i>time</i> utility.</dd>
     97 </dl>
     98 </blockquote>
     99 <h4 class="mansect"><a name="tag_20_05_05" id="tag_20_05_05"></a>OPERANDS</h4>
    100 <blockquote>
    101 <p>The following operands shall be supported:</p>
    102 <dl compact>
    103 <dd></dd>
    104 <dt><i>at_job_id</i></dt>
    105 <dd>The name reported by a previous invocation of the <i>at</i> utility at the time the job was scheduled.</dd>
    106 <dt><i>timespec</i></dt>
    107 <dd>Submit the job to be run at the date and time specified. All of the <i>timespec</i> operands are interpreted as if they were
    108 separated by &lt;space&gt; characters and concatenated, and shall be parsed as described in the grammar at the end of this section.
    109 The date and time shall be interpreted as being in the timezone of the user (as determined by the <i>TZ</i> variable), unless a
    110 timezone name appears as part of <i>time</i>, below.
    111 <p>In the POSIX locale, the following describes the three parts of the time specification string. All of the values from the
    112 <i>LC_TIME</i> categories in the POSIX locale shall be recognized in a case-insensitive manner.</p>
    113 <dl compact>
    114 <dd></dd>
    115 <dt><i>time</i></dt>
    116 <dd>The time can be specified as one, two, or four digits. One-digit and two-digit numbers shall be taken to be hours; four-digit
    117 numbers to be hours and minutes. The time can alternatively be specified as two numbers separated by a &lt;colon&gt;, meaning
    118 <i>hour</i>:<i>minute</i>. If the <i>LC_TIME</i> category of the locale supports 12-hour time format (see XBD <a href=
    119 "../basedefs/V1_chap07.html#tag_07_03_05"><i>7.3.5 LC_TIME</i></a> ), an AM/PM indication in the form of one of the values from the
    120 <b>am_pm</b> keywords in the <i>LC_TIME</i> locale category can follow the time; otherwise, a 24-hour clock time shall be
    121 understood. A timezone name can also follow to further qualify the time. The acceptable timezone names are implementation-defined,
    122 except that they shall be case-insensitive and the string <b>utc</b> is supported to indicate the time is in Coordinated Universal
    123 Time. In the POSIX locale, the <i>time</i> field can also be one of the following tokens:
    124 <dl compact>
    125 <dd></dd>
    126 <dt><b>midnight</b></dt>
    127 <dd>Indicates the time 12:00 am (00:00).</dd>
    128 <dt><b>noon</b></dt>
    129 <dd>Indicates the time 12:00 pm.</dd>
    130 <dt><b>now</b></dt>
    131 <dd>Indicates the current day and time. Invoking <i>at</i> &lt;<b>now</b>&gt; shall submit an at-job for potentially immediate
    132 execution (that is, subject only to unspecified scheduling delays).</dd>
    133 </dl>
    134 </dd>
    135 <dt><i>date</i></dt>
    136 <dd>An optional <i>date</i> can be specified as either a month name (one of the values from the <b>mon</b> or <b>abmon</b> keywords
    137 in the <i>LC_TIME</i> locale category) followed by a day number (and possibly year number preceded by a comma), or a day of the
    138 week (one of the values from the <b>day</b> or <b>abday</b> keywords in the <i>LC_TIME</i> locale category). In the POSIX locale,
    139 two special days shall be recognized:
    140 <dl compact>
    141 <dd></dd>
    142 <dt><b>today</b></dt>
    143 <dd>Indicates the current day.</dd>
    144 <dt><b>tomorrow</b></dt>
    145 <dd>Indicates the day following the current day.</dd>
    146 </dl>
    147 <p>If no <i>date</i> is given, <b>today</b> shall be assumed if the given time is greater than the current time, and
    148 <b>tomorrow</b> shall be assumed if it is less. If the given month is less than the current month (and no year is given), next year
    149 shall be assumed.</p>
    150 </dd>
    151 <dt><i>increment</i></dt>
    152 <dd>The optional <i>increment</i> shall be a number preceded by a &lt;plus-sign&gt; (<tt>'+'</tt>) and suffixed by one of the
    153 following: <b>minutes</b>, <b>hours</b>, <b>days</b>, <b>weeks</b>, <b>months</b>, or <b>years</b>. (The singular forms shall also
    154 be accepted.) The keyword <b>next</b> shall be equivalent to an increment number of +1. For example, the following are equivalent
    155 commands:
    156 <pre>
    157 <tt>at 2pm + 1 week
    158 at 2pm next week
    159 </tt></pre></dd>
    160 </dl>
    161 </dd>
    162 </dl>
    163 <p>The following grammar describes the precise format of <i>timespec</i> in the POSIX locale. The general conventions for this
    164 style of grammar are described in <a href="../utilities/V3_chap01.html#tag_18_03"><i>1.3 Grammar Conventions</i></a> . This formal
    165 syntax shall take precedence over the preceding text syntax description. The longest possible token or delimiter shall be
    166 recognized at a given point. When used in a <i>timespec</i>, white space shall also delimit tokens.</p>
    167 <pre>
    168 <tt>%token hr24clock_hr_min
    169 %token hr24clock_hour
    170 /*
    171   An hr24clock_hr_min is a one, two, or four-digit number. A one-digit
    172   or two-digit number constitutes an hr24clock_hour. An hr24clock_hour
    173   may be any of the single digits [0,9], or may be double digits, ranging
    174   from [00,23]. If an hr24clock_hr_min is a four-digit number, the
    175   first two digits shall be a valid hr24clock_hour, while the last two
    176   represent the number of minutes, from [00,59].
    177 */
    178 <br>
    179 %token wallclock_hr_min
    180 %token wallclock_hour
    181 /*
    182   A wallclock_hr_min is a one, two-digit, or four-digit number.
    183   A one-digit or two-digit number constitutes a wallclock_hour.
    184   A wallclock_hour may be any of the single digits [1,9], or may
    185   be double digits, ranging from [01,12]. If a wallclock_hr_min
    186   is a four-digit number, the first two digits shall be a valid
    187   wallclock_hour, while the last two represent the number of
    188   minutes, from [00,59].
    189 */
    190 <br>
    191 %token minute
    192 /*
    193   A minute is a one or two-digit number whose value can be [0,9]
    194   or [00,59].
    195 */
    196 <br>
    197 %token day_number
    198 /*
    199   A day_number is a number in the range appropriate for the particular
    200   month and year specified by month_name and year_number, respectively.
    201   If no year_number is given, the current year is assumed if the given
    202   date and time are later this year. If no year_number is given and
    203   the date and time have already occurred this year and the month is
    204   not the current month, next year is the assumed year.
    205 */
    206 <br>
    207 %token year_number
    208 /*
    209   A year_number is a four-digit number representing the year A.D., in
    210   which the at_job is to be run.
    211 */
    212 <br>
    213 %token inc_number
    214 /*
    215   The inc_number is the number of times the succeeding increment
    216   period is to be added to the specified date and time.
    217 */
    218 <br>
    219 %token timezone_name
    220 /*
    221   The name of an optional timezone suffix to the time field, in an
    222   implementation-defined format.
    223 */
    224 <br>
    225 %token month_name
    226 /*
    227   One of the values from the mon or abmon keywords in the LC_TIME
    228   locale category.
    229 */
    230 <br>
    231 %token day_of_week
    232 /*
    233   One of the values from the day or abday keywords in the LC_TIME
    234   locale category.
    235 */
    236 <br>
    237 %token am_pm
    238 /*
    239   One of the values from the am_pm keyword in the LC_TIME locale
    240   category.
    241 */
    242 <br>
    243 %start timespec
    244 %%
    245 timespec    : time
    246             | time date
    247             | time increment
    248             | time date increment
    249             | nowspec
    250             ;
    251 <br>
    252 nowspec     : "now"
    253             | "now" increment
    254             ;
    255 <br>
    256 time        : hr24clock_hr_min
    257             | hr24clock_hr_min timezone_name
    258             | hr24clock_hour ":" minute
    259             | hr24clock_hour ":" minute timezone_name
    260             | wallclock_hr_min am_pm
    261             | wallclock_hr_min am_pm timezone_name
    262             | wallclock_hour ":" minute am_pm
    263             | wallclock_hour ":" minute am_pm timezone_name
    264             | "noon"
    265             | "midnight"
    266             ;
    267 <br>
    268 date        : month_name day_number
    269             | month_name day_number "," year_number
    270             | day_of_week
    271             | "today"
    272             | "tomorrow"
    273             ;
    274 <br>
    275 increment   : "+" inc_number inc_period
    276             | "next" inc_period
    277             ;
    278 <br>
    279 inc_period  : "minute" | "minutes"
    280             | "hour" | "hours"
    281             | "day" | "days"
    282             | "week" | "weeks"
    283             | "month" | "months"
    284             | "year" | "years"
    285             ;
    286 </tt></pre></blockquote>
    287 <h4 class="mansect"><a name="tag_20_05_06" id="tag_20_05_06"></a>STDIN</h4>
    288 <blockquote>
    289 <p>The standard input shall be a text file consisting of commands acceptable to the shell command language described in <a href=
    290 "../utilities/V3_chap02.html#tag_19"><i>2. Shell Command Language</i></a> . The standard input shall only be used if no <b>-f</b>
    291 <i>file</i> option is specified.</p>
    292 </blockquote>
    293 <h4 class="mansect"><a name="tag_20_05_07" id="tag_20_05_07"></a>INPUT FILES</h4>
    294 <blockquote>
    295 <p>See the STDIN section.</p>
    296 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    297 The text files <b>at.allow</b> and <b>at.deny</b>, which are located in an implementation-defined directory, shall contain zero or
    298 more user names, one per line, of users who are, respectively, authorized or denied access to the <i>at</i> and <a href=
    299 "../utilities/batch.html"><i>batch</i></a> utilities. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
    300 </blockquote>
    301 <h4 class="mansect"><a name="tag_20_05_08" id="tag_20_05_08"></a>ENVIRONMENT VARIABLES</h4>
    302 <blockquote>
    303 <p>The following environment variables shall affect the execution of <i>at</i>:</p>
    304 <dl compact>
    305 <dd></dd>
    306 <dt><i>LANG</i></dt>
    307 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
    308 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
    309 variables used to determine the values of locale categories.)</dd>
    310 <dt><i>LC_ALL</i></dt>
    311 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
    312 <dt><i>LC_CTYPE</i></dt>
    313 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    314 opposed to multi-byte characters in arguments and input files).</dd>
    315 <dt><i>LC_MESSAGES</i></dt>
    316 <dd><br>
    317 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and
    318 informative messages written to standard output.</dd>
    319 <dt><i>NLSPATH</i></dt>
    320 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    321 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
    322 "0"></dd>
    323 <dt><i>LC_TIME</i></dt>
    324 <dd>Determine the format and contents for date and time strings written and accepted by <i>at</i>.</dd>
    325 <dt><i>SHELL</i></dt>
    326 <dd>Determine a name of a command interpreter to be used to invoke the at-job. If the variable is unset or null, <a href=
    327 "../utilities/sh.html"><i>sh</i></a> shall be used. If it is set to a value other than a name for <a href=
    328 "../utilities/sh.html"><i>sh</i></a>, the implementation shall do one of the following: use that shell; use <a href=
    329 "../utilities/sh.html"><i>sh</i></a>; use the login shell from the user database; or any of the preceding accompanied by a warning
    330 diagnostic about which was chosen.</dd>
    331 <dt><i>TZ</i></dt>
    332 <dd>Determine the timezone. The job shall be submitted for execution at the time specified by <i>timespec</i> or <b>-t</b>
    333 <i>time</i> relative to the timezone specified by the <i>TZ</i> variable. If <i>timespec</i> specifies a timezone, it shall
    334 override <i>TZ .</i> If <i>timespec</i> does not specify a timezone and <i>TZ</i> is unset or null, an unspecified default timezone
    335 shall be used.</dd>
    336 </dl>
    337 </blockquote>
    338 <h4 class="mansect"><a name="tag_20_05_09" id="tag_20_05_09"></a>ASYNCHRONOUS EVENTS</h4>
    339 <blockquote>
    340 <p>Default.</p>
    341 </blockquote>
    342 <h4 class="mansect"><a name="tag_20_05_10" id="tag_20_05_10"></a>STDOUT</h4>
    343 <blockquote>
    344 <p>When standard input is a terminal, prompts of unspecified format for each line of the user input described in the STDIN section
    345 may be written to standard output.</p>
    346 <p>In the POSIX locale, the following shall be written to the standard output for each job when jobs are listed in response to the
    347 <b>-l</b> option:</p>
    348 <pre>
    349 <tt>"%s\t%s\n", </tt><i>at_job_id</i><tt>, &lt;</tt><i>date</i><tt>&gt;
    350 </tt></pre>
    351 <p>where <i>date</i> shall be equivalent in format to the output of:</p>
    352 <pre>
    353 <tt>date +"%a %b %e %T %Y"
    354 </tt></pre>
    355 <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>
    356 variable).</p>
    357 </blockquote>
    358 <h4 class="mansect"><a name="tag_20_05_11" id="tag_20_05_11"></a>STDERR</h4>
    359 <blockquote>
    360 <p>In the POSIX locale, the following shall be written to standard error when a job has been successfully submitted:</p>
    361 <pre>
    362 <tt>"job %s at %s\n", </tt><i>at_job_id</i><tt>, &lt;</tt><i>date</i><tt>&gt;
    363 </tt></pre>
    364 <p>where <i>date</i> has the same format as that described in the STDOUT section. Neither this, nor warning messages concerning the
    365 selection of the command interpreter, shall be considered a diagnostic that changes the exit status.</p>
    366 <p>Diagnostic messages, if any, shall be written to standard error.</p>
    367 </blockquote>
    368 <h4 class="mansect"><a name="tag_20_05_12" id="tag_20_05_12"></a>OUTPUT FILES</h4>
    369 <blockquote>
    370 <p>None.</p>
    371 </blockquote>
    372 <h4 class="mansect"><a name="tag_20_05_13" id="tag_20_05_13"></a>EXTENDED DESCRIPTION</h4>
    373 <blockquote>
    374 <p>None.</p>
    375 </blockquote>
    376 <h4 class="mansect"><a name="tag_20_05_14" id="tag_20_05_14"></a>EXIT STATUS</h4>
    377 <blockquote>
    378 <p>The following exit values shall be returned:</p>
    379 <dl compact>
    380 <dd></dd>
    381 <dt>&nbsp;0</dt>
    382 <dd>Neither the <b>-l</b> option nor the <b>-r</b> option was specified and a job was successfully submitted; or, the <b>-l</b>
    383 option was specified with no <i>at_job_id</i> operands and there were no jobs to be listed; or, the <b>-l</b> option was specified
    384 and all job listings were successfully output; or, the <b>-r</b> option was specified and all of the specified jobs were
    385 successfully removed.</dd>
    386 <dt>&gt;0</dt>
    387 <dd>An error occurred.</dd>
    388 </dl>
    389 </blockquote>
    390 <h4 class="mansect"><a name="tag_20_05_15" id="tag_20_05_15"></a>CONSEQUENCES OF ERRORS</h4>
    391 <blockquote>
    392 <p>If neither the <b>-l</b> option nor the <b>-r</b> option was specified, the job shall not be scheduled. Otherwise, the default
    393 actions specified in <a href="../utilities/V3_chap01.html#tag_18_04"><i>1.4 Utility Description Defaults</i></a> apply.</p>
    394 </blockquote>
    395 <hr>
    396 <div class="box"><em>The following sections are informative.</em></div>
    397 <h4 class="mansect"><a name="tag_20_05_16" id="tag_20_05_16"></a>APPLICATION USAGE</h4>
    398 <blockquote>
    399 <p>The format of the <i>at</i> command line shown here is guaranteed only for the POSIX locale. Other cultures may be supported
    400 with substantially different interfaces, although implementations are encouraged to provide comparable levels of functionality.</p>
    401 <p>Since the commands run in a separate shell invocation, running in a separate process group with no controlling terminal, open
    402 file descriptors, traps, and priority inherited from the invoking environment are lost.</p>
    403 <p>Some implementations do not allow substitution of different shells using <i>SHELL .</i> System V systems, for example, have used
    404 the login shell value for the user in <b>/etc/passwd</b>. To select reliably another command interpreter, the user must include it
    405 as part of the script, such as:</p>
    406 <pre>
    407 <b>$</b><tt> at 1800
    408 myshell myscript
    409 EOT
    410 </tt><b>job ... at ...
    411 $</b><tt>
    412 </tt></pre></blockquote>
    413 <h4 class="mansect"><a name="tag_20_05_17" id="tag_20_05_17"></a>EXAMPLES</h4>
    414 <blockquote>
    415 <ol>
    416 <li>
    417 <p>This sequence can be used at a terminal:</p>
    418 <pre>
    419 <tt>at -m 0730 tomorrow
    420 sort &lt; file &gt;outfile
    421 EOT
    422 </tt></pre></li>
    423 <li>
    424 <p>This sequence, which demonstrates redirecting standard error to a pipe, is useful in a command procedure (the sequence of output
    425 redirection specifications is significant):</p>
    426 <pre>
    427 <tt>at now + 1 hour &lt;&lt;!
    428 diff file1 file2 2&gt;&amp;1 &gt;outfile | mailx -s "outfile update" mygroup
    429 !
    430 </tt></pre>
    431 <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
    432 empty unless an error occurred.</p>
    433 </li>
    434 <li>
    435 <p>The following shows how to capture both standard error and standard output:</p>
    436 <pre>
    437 <tt>at now + 1 hour &lt;&lt;EOF
    438 {
    439     run-batch-processing |
    440         mailx -s "batch processing output" mygroup
    441 } 2&gt;&amp;1 | mailx -E -s "errors during batch processing" mygroup
    442 EOF
    443 </tt></pre></li>
    444 <li>
    445 <p>To have a job reschedule itself, <i>at</i> can be invoked from within the at-job. For example, this daily processing script
    446 named <b>my.daily</b> runs every day (although <a href="../utilities/crontab.html"><i>crontab</i></a> is a more appropriate vehicle
    447 for such work):</p>
    448 <pre>
    449 <tt># my.daily runs every day
    450 </tt><i>daily processing</i><tt>
    451 at now tomorrow &lt; my.daily
    452 </tt></pre></li>
    453 <li>
    454 <p>The spacing of the three portions of the POSIX locale <i>timespec</i> is quite flexible as long as there are no ambiguities.
    455 Examples of various times and operand presentation include:</p>
    456 <pre>
    457 <tt>at 0815am Jan 24
    458 at 8 :15amjan24
    459 at now "+ 1day"
    460 at 5 pm FRIday
    461 at '17
    462     utc+
    463     30minutes'
    464 </tt></pre></li>
    465 </ol>
    466 </blockquote>
    467 <h4 class="mansect"><a name="tag_20_05_18" id="tag_20_05_18"></a>RATIONALE</h4>
    468 <blockquote>
    469 <p>The <i>at</i> utility reads from standard input the commands to be executed at a later time. It may be useful to redirect
    470 standard output and standard error within the specified commands.</p>
    471 <p>The <b>-t</b> <i>time</i> option was added as a new capability to support an internationalized way of specifying a time for
    472 execution of the submitted job.</p>
    473 <p>Early proposals added a &quot;jobname&quot; concept as a way of giving submitted jobs names that are meaningful to the user submitting
    474 them. The historical, system-specified <i>at_job_id</i> gives no indication of what the job is. Upon further reflection, it was
    475 decided that the benefit of this was not worth the change in historical interface.</p>
    476 <p>The <b>-q</b> option historically has been an undocumented option, used mainly by the <a href=
    477 "../utilities/batch.html"><i>batch</i></a> utility.</p>
    478 <p>The System V <b>-m</b> option was added to provide a method for informing users that an at-job had completed. Otherwise, users
    479 are only informed when output to standard error or standard output are not redirected.</p>
    480 <p>The behavior of <i>at</i> &lt;<b>now</b>&gt; was changed in an early proposal from being unspecified to submitting a job for
    481 potentially immediate execution. Historical BSD <i>at</i> implementations support this. Historical System V implementations give an
    482 error in that case, but a change to the System V versions should have no backwards-compatibility ramifications.</p>
    483 <p>On BSD-based systems, a <b>-u</b> <i>user</i> option has allowed those with appropriate privileges to access the work of other
    484 users. Since this is primarily a system administration feature and is not universally implemented, it has been omitted. Similarly,
    485 a specification for the output format for a user with appropriate privileges viewing the queues of other users has been
    486 omitted.</p>
    487 <p>The <b>-f</b> <i>file</i> option from System V is used instead of the BSD method of using the last operand as the pathname. The
    488 BSD method is ambiguous—does:</p>
    489 <pre>
    490 <tt>at 1200 friday
    491 </tt></pre>
    492 <p>mean the same thing if there is a file named <b>friday</b> in the current directory?</p>
    493 <p>The <i>at_job_id</i> is composed of a limited character set in historical practice, and it is mandated here to invalidate
    494 systems that might try using characters that require shell quoting or that could not be easily parsed by shell scripts.</p>
    495 <p>The <i>at</i> utility varies between System V and BSD systems in the way timezones are used. On System V systems, the <i>TZ</i>
    496 variable affects the at-job submission times and the times displayed for the user. On BSD systems, <i>TZ</i> is not taken into
    497 account. The BSD behavior is easily achieved with the current specification. If the user wishes to have the timezone default to
    498 that of the system, they merely need to issue the <i>at</i> command immediately following an unsetting or null assignment to <i>TZ
    499 .</i> For example:</p>
    500 <pre>
    501 <tt>TZ= at noon ...
    502 </tt></pre>
    503 <p>gives the desired BSD result.</p>
    504 <p>While the <a href="../utilities/yacc.html"><i>yacc</i></a>-like grammar specified in the OPERANDS section is lexically
    505 unambiguous with respect to the digit strings, a lexical analyzer would probably be written to look for and return digit strings in
    506 those cases. The parser could then check whether the digit string returned is a valid <i>day_number</i>, <i>year_number</i>, and so
    507 on, based on the context.</p>
    508 </blockquote>
    509 <h4 class="mansect"><a name="tag_20_05_19" id="tag_20_05_19"></a>FUTURE DIRECTIONS</h4>
    510 <blockquote>
    511 <p>None.</p>
    512 </blockquote>
    513 <h4 class="mansect"><a name="tag_20_05_20" id="tag_20_05_20"></a>SEE ALSO</h4>
    514 <blockquote>
    515 <p><a href="../utilities/batch.html#"><i>batch</i></a> , <a href="../utilities/crontab.html#"><i>crontab</i></a></p>
    516 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    517 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    518 </blockquote>
    519 <h4 class="mansect"><a name="tag_20_05_21" id="tag_20_05_21"></a>CHANGE HISTORY</h4>
    520 <blockquote>
    521 <p>First released in Issue 2.</p>
    522 </blockquote>
    523 <h4 class="mansect"><a name="tag_20_05_22" id="tag_20_05_22"></a>Issue 6</h4>
    524 <blockquote>
    525 <p>This utility is marked as part of the User Portability Utilities option.</p>
    526 <p>The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:</p>
    527 <ul>
    528 <li>
    529 <p>If <b>-m</b> is not used, the job's standard output and standard error are provided to the user by mail.</p>
    530 </li>
    531 </ul>
    532 <p>The effects of using the <b>-q</b> and <b>-t</b> options as defined in the IEEE&nbsp;P1003.2b draft standard are specified.</p>
    533 <p>The normative text is reworded to avoid use of the term &quot;must&quot; for application requirements.</p>
    534 </blockquote>
    535 <h4 class="mansect"><a name="tag_20_05_23" id="tag_20_05_23"></a>Issue 7</h4>
    536 <blockquote>
    537 <p>The <i>at</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an
    538 option for interactive utilities.</p>
    539 <p>SD5-XCU-ERN-95 is applied, removing the references to fixed locations for the files referenced by the <i>at</i> utility.</p>
    540 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p>
    541 </blockquote>
    542 <h4 class="mansect"><a name="tag_20_05_24" id="tag_20_05_24"></a>Issue 8</h4>
    543 <blockquote>
    544 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    545 <p>Austin Group Defect 1307 is applied, changing the <i>timespec</i> operand in relation to locales that do not support the 12-hour
    546 clock format.</p>
    547 <p>Austin Group Defect 1330 is applied, removing obsolescent interfaces.</p>
    548 <p>Austin Group Defect 1368 is applied, changing the EXAMPLES section.</p>
    549 <p>Austin Group Defect 1377 is applied, correcting a typographic error in the description of the <b>-q</b> option.</p>
    550 <p>Austin Group Defect 1495 is applied, changing the EXIT STATUS and CONSEQUENCES OF ERRORS sections.</p>
    551 </blockquote>
    552 <div class="box"><em>End of informative text.</em></div>
    553 <hr>
    554 <p>&nbsp;</p>
    555 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    556 <hr size="2" noshade>
    557 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    558 POSIX™ is a Trademark of The IEEE.<br>
    559 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    560 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    561 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    562 ]</font></center>
    563 <hr size="2" noshade>
    564 <div class="NAVHEADER">
    565 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    566 <tr class="nav">
    567 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/asa.html" accesskey="P">&lt;&lt;&lt;
    568 Previous</a></td>
    569 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    570 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/awk.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    571 </tr>
    572 </table>
    573 <hr align="left" width="100%"></div>
    574 </body>
    575 </html>