isposix

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

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

fg.html (11472B)


      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>fg</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/fc.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/file.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="fg" id="fg"></a> <a name="tag_20_45" id="tag_20_45"></a><!-- fg -->
     28 <h4 class="mansect"><a name="tag_20_45_01" id="tag_20_45_01"></a>NAME</h4>
     29 <blockquote>fg — run jobs in the foreground</blockquote>
     30 <h4 class="mansect"><a name="tag_20_45_02" id="tag_20_45_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt=
     33 "[Option Start]" border="0"> fg</tt> <b>[</b><i>job_id</i><b>]</b> <tt><img src="../images/opt-end.gif" alt="[Option End]" border=
     34 "0"></tt></code></div>
     35 </blockquote>
     36 <h4 class="mansect"><a name="tag_20_45_03" id="tag_20_45_03"></a>DESCRIPTION</h4>
     37 <blockquote>
     38 <p>If job control is enabled (see the description of <a href="../utilities/V3_chap02.html#set"><i>set</i></a> <b>-m</b>), the shell
     39 is interactive, and the current shell execution environment (see <a href="../utilities/V3_chap02.html#tag_19_13"><i>2.13 Shell
     40 Execution Environment</i></a> ) is not a subshell environment, the <i>fg</i> utility shall move a background job in the current
     41 execution environment into the foreground, as described in <a href="../utilities/V3_chap02.html#tag_19_11"><i>2.11 Job
     42 Control</i></a> ; it may also do so if the shell is non-interactive or the current shell execution environment is a subshell
     43 environment.</p>
     44 <p>Using <i>fg</i> to place a job into the foreground shall remove its process ID from the list of those &quot;known in the current
     45 shell execution environment&quot;; see <a href="../utilities/V3_chap02.html#tag_19_09_03_02"><i>2.9.3.1 Asynchronous AND-OR
     46 Lists</i></a> .</p>
     47 </blockquote>
     48 <h4 class="mansect"><a name="tag_20_45_04" id="tag_20_45_04"></a>OPTIONS</h4>
     49 <blockquote>
     50 <p>None.</p>
     51 </blockquote>
     52 <h4 class="mansect"><a name="tag_20_45_05" id="tag_20_45_05"></a>OPERANDS</h4>
     53 <blockquote>
     54 <p>The following operand shall be supported:</p>
     55 <dl compact>
     56 <dd></dd>
     57 <dt><i>job_id</i></dt>
     58 <dd>Specify the job to be run as a foreground job. If no <i>job_id</i> operand is given, the <i>job_id</i> for the job that was
     59 most recently suspended, placed in the background, or run as a background job shall be used. The format of <i>job_id</i> is
     60 described in XBD <a href="../basedefs/V1_chap03.html#tag_03_182"><i>3.182 Job ID</i></a> .</dd>
     61 </dl>
     62 </blockquote>
     63 <h4 class="mansect"><a name="tag_20_45_06" id="tag_20_45_06"></a>STDIN</h4>
     64 <blockquote>
     65 <p>Not used.</p>
     66 </blockquote>
     67 <h4 class="mansect"><a name="tag_20_45_07" id="tag_20_45_07"></a>INPUT FILES</h4>
     68 <blockquote>
     69 <p>None.</p>
     70 </blockquote>
     71 <h4 class="mansect"><a name="tag_20_45_08" id="tag_20_45_08"></a>ENVIRONMENT VARIABLES</h4>
     72 <blockquote>
     73 <p>The following environment variables shall affect the execution of <i>fg</i>:</p>
     74 <dl compact>
     75 <dd></dd>
     76 <dt><i>LANG</i></dt>
     77 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
     78 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
     79 variables used to determine the values of locale categories.)</dd>
     80 <dt><i>LC_ALL</i></dt>
     81 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
     82 <dt><i>LC_CTYPE</i></dt>
     83 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
     84 opposed to multi-byte characters in arguments).</dd>
     85 <dt><i>LC_MESSAGES</i></dt>
     86 <dd><br>
     87 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
     88 <dt><i>NLSPATH</i></dt>
     89 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     90 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
     91 "0"></dd>
     92 </dl>
     93 </blockquote>
     94 <h4 class="mansect"><a name="tag_20_45_09" id="tag_20_45_09"></a>ASYNCHRONOUS EVENTS</h4>
     95 <blockquote>
     96 <p>Default.</p>
     97 </blockquote>
     98 <h4 class="mansect"><a name="tag_20_45_10" id="tag_20_45_10"></a>STDOUT</h4>
     99 <blockquote>
    100 <p>The <i>fg</i> utility shall write the command line of the job to standard output in the following format:</p>
    101 <pre>
    102 <tt>"%s\n", &lt;</tt><i>command</i><tt>&gt;
    103 </tt></pre></blockquote>
    104 <h4 class="mansect"><a name="tag_20_45_11" id="tag_20_45_11"></a>STDERR</h4>
    105 <blockquote>
    106 <p>The standard error shall be used only for diagnostic messages.</p>
    107 </blockquote>
    108 <h4 class="mansect"><a name="tag_20_45_12" id="tag_20_45_12"></a>OUTPUT FILES</h4>
    109 <blockquote>
    110 <p>None.</p>
    111 </blockquote>
    112 <h4 class="mansect"><a name="tag_20_45_13" id="tag_20_45_13"></a>EXTENDED DESCRIPTION</h4>
    113 <blockquote>
    114 <p>None.</p>
    115 </blockquote>
    116 <h4 class="mansect"><a name="tag_20_45_14" id="tag_20_45_14"></a>EXIT STATUS</h4>
    117 <blockquote>
    118 <p>If the <i>fg</i> utility succeeds, it does not return an exit status. Instead, the shell waits for the job that <i>fg</i> moved
    119 into the foreground.</p>
    120 <p>If <i>fg</i> does not move a job into the foreground, the following exit value shall be returned:</p>
    121 <dl compact>
    122 <dd></dd>
    123 <dt>&gt;0</dt>
    124 <dd>An error occurred.</dd>
    125 </dl>
    126 </blockquote>
    127 <h4 class="mansect"><a name="tag_20_45_15" id="tag_20_45_15"></a>CONSEQUENCES OF ERRORS</h4>
    128 <blockquote>
    129 <p>If job control is disabled, the <i>fg</i> utility shall exit with an error and no job shall be placed in the foreground.</p>
    130 </blockquote>
    131 <hr>
    132 <div class="box"><em>The following sections are informative.</em></div>
    133 <h4 class="mansect"><a name="tag_20_45_16" id="tag_20_45_16"></a>APPLICATION USAGE</h4>
    134 <blockquote>
    135 <p>This utility is required to be intrinsic. See <a href="../utilities/V3_chap01.html#tag_18_07"><i>1.7 Intrinsic Utilities</i></a>
    136 for details.</p>
    137 <p>The <i>fg</i> utility does not work as expected when it is operating in its own utility execution environment because that
    138 environment has no applicable jobs to manipulate. See the APPLICATION USAGE section for <a href=
    139 "../utilities/bg.html#"><i>bg</i></a> . For this reason, <i>fg</i> is generally implemented as a shell regular built-in.</p>
    140 </blockquote>
    141 <h4 class="mansect"><a name="tag_20_45_17" id="tag_20_45_17"></a>EXAMPLES</h4>
    142 <blockquote>
    143 <p>None.</p>
    144 </blockquote>
    145 <h4 class="mansect"><a name="tag_20_45_18" id="tag_20_45_18"></a>RATIONALE</h4>
    146 <blockquote>
    147 <p>The extensions to the shell specified in this volume of POSIX.1-2024 have mostly been based on features provided by the
    148 KornShell. The job control features provided by <a href="../utilities/bg.html"><i>bg</i></a>, <i>fg</i>, and <a href=
    149 "../utilities/jobs.html"><i>jobs</i></a> are also based on the KornShell. The standard developers examined the characteristics of
    150 the C shell versions of these utilities and found that differences exist. Despite widespread use of the C shell, the KornShell
    151 versions were selected for this volume of POSIX.1-2024 to maintain a degree of uniformity with the rest of the KornShell features
    152 selected (such as the very popular command line editing features).</p>
    153 </blockquote>
    154 <h4 class="mansect"><a name="tag_20_45_19" id="tag_20_45_19"></a>FUTURE DIRECTIONS</h4>
    155 <blockquote>
    156 <p>None.</p>
    157 </blockquote>
    158 <h4 class="mansect"><a name="tag_20_45_20" id="tag_20_45_20"></a>SEE ALSO</h4>
    159 <blockquote>
    160 <p><a href="../utilities/V3_chap02.html#tag_19_09_03_02"><i>2.9.3.1 Asynchronous AND-OR Lists</i></a> , <a href=
    161 "../utilities/V3_chap02.html#tag_19_13"><i>2.13 Shell Execution Environment</i></a> , <a href="../utilities/bg.html#"><i>bg</i></a>
    162 , <a href="../utilities/kill.html#tag_20_64"><i>kill</i></a> , <a href="../utilities/jobs.html#"><i>jobs</i></a> , <a href=
    163 "../utilities/wait.html#tag_20_147"><i>wait</i></a></p>
    164 <p>XBD <a href="../basedefs/V1_chap03.html#tag_03_182"><i>3.182 Job ID</i></a> , <a href="../basedefs/V1_chap08.html#tag_08"><i>8.
    165 Environment Variables</i></a></p>
    166 </blockquote>
    167 <h4 class="mansect"><a name="tag_20_45_21" id="tag_20_45_21"></a>CHANGE HISTORY</h4>
    168 <blockquote>
    169 <p>First released in Issue 4.</p>
    170 </blockquote>
    171 <h4 class="mansect"><a name="tag_20_45_22" id="tag_20_45_22"></a>Issue 6</h4>
    172 <blockquote>
    173 <p>This utility is marked as part of the User Portability Utilities option.</p>
    174 <p>The APPLICATION USAGE section is added.</p>
    175 <p>The JC marking is removed from the SYNOPSIS since job control is mandatory is this version.</p>
    176 </blockquote>
    177 <h4 class="mansect"><a name="tag_20_45_23" id="tag_20_45_23"></a>Issue 8</h4>
    178 <blockquote>
    179 <p>Austin Group Defect 854 is applied, adding a note to the APPLICATION USAGE section that this utility is required to be
    180 intrinsic.</p>
    181 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    182 <p>Austin Group Defect 1254 is applied, updating the DESCRIPTION to account for the addition of <a href=
    183 "../utilities/V3_chap02.html#tag_19_11"><i>2.11 Job Control</i></a> and changing the EXIT STATUS section.</p>
    184 </blockquote>
    185 <div class="box"><em>End of informative text.</em></div>
    186 <hr>
    187 <p>&nbsp;</p>
    188 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    189 <hr size="2" noshade>
    190 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    191 POSIX™ is a Trademark of The IEEE.<br>
    192 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    193 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    194 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    195 ]</font></center>
    196 <hr size="2" noshade>
    197 <div class="NAVHEADER">
    198 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    199 <tr class="nav">
    200 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/fc.html" accesskey="P">&lt;&lt;&lt;
    201 Previous</a></td>
    202 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    203 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/file.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    204 </tr>
    205 </table>
    206 <hr align="left" width="100%"></div>
    207 </body>
    208 </html>