Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
tsort.html (11406B)
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>tsort</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/true.html" accesskey="P"><<< 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/tty.html" accesskey="N">Next >>></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="tsort" id="tsort"></a> <a name="tag_20_128" id="tag_20_128"></a><!-- tsort --> 28 <h4 class="mansect"><a name="tag_20_128_01" id="tag_20_128_01"></a>NAME</h4> 29 <blockquote>tsort — topological sort</blockquote> 30 <h4 class="mansect"><a name="tag_20_128_02" id="tag_20_128_02"></a>SYNOPSIS</h4> 31 <blockquote class="synopsis"> 32 <p><code><tt>tsort</tt> <b>[</b><tt>-w</tt><b>] [</b><i>file</i><b>]</b></code></p> 33 </blockquote> 34 <h4 class="mansect"><a name="tag_20_128_03" id="tag_20_128_03"></a>DESCRIPTION</h4> 35 <blockquote> 36 <p>The <i>tsort</i> utility shall write to standard output a totally ordered list of items consistent with a partial ordering of 37 items contained in the input.</p> 38 <p>The application shall ensure that the input consists of pairs of items (non-empty strings) separated by one or more 39 <blank> or <newline> characters. It is unspecified whether other white-space characters can also be used as separators. 40 Pairs of different items shall indicate ordering. Pairs of identical items shall indicate presence, but not ordering.</p> 41 <p>If a cycle is found in the input, diagnostic or warning messages shall be written to standard error reporting that there is a 42 cycle and indicating which nodes are in the cycle(s). If the <b>-w</b> option is specified, these messages shall be diagnostic 43 messages. If a diagnostic message is written, the final exit status shall be non-zero.</p> 44 </blockquote> 45 <h4 class="mansect"><a name="tag_20_128_04" id="tag_20_128_04"></a>OPTIONS</h4> 46 <blockquote> 47 <p>The <i>tsort</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 48 Guidelines</i></a> .</p> 49 <p>The following option shall be supported:</p> 50 <dl compact> 51 <dd></dd> 52 <dt><b>-w</b></dt> 53 <dd>Set the exit status to the number of cycles found in the input, or to an implementation-defined maximum if there are more 54 cycles than that maximum. If no cycles are found, the exit status shall be zero unless another error occurs.</dd> 55 </dl> 56 </blockquote> 57 <h4 class="mansect"><a name="tag_20_128_05" id="tag_20_128_05"></a>OPERANDS</h4> 58 <blockquote> 59 <p>The following operand shall be supported:</p> 60 <dl compact> 61 <dd></dd> 62 <dt><i>file</i></dt> 63 <dd>A pathname of a text file to order. If no <i>file</i> operand is given, the standard input shall be used.</dd> 64 </dl> 65 </blockquote> 66 <h4 class="mansect"><a name="tag_20_128_06" id="tag_20_128_06"></a>STDIN</h4> 67 <blockquote> 68 <p>The standard input shall be used if no <i>file</i> operand is specified, and shall be used if the <i>file</i> operand is 69 <tt>'-'</tt> and the implementation treats the <tt>'-'</tt> as meaning standard input. Otherwise, the standard input shall not be 70 used. See the INPUT FILES section.</p> 71 </blockquote> 72 <h4 class="mansect"><a name="tag_20_128_07" id="tag_20_128_07"></a>INPUT FILES</h4> 73 <blockquote> 74 <p>The input file shall be a text file.</p> 75 </blockquote> 76 <h4 class="mansect"><a name="tag_20_128_08" id="tag_20_128_08"></a>ENVIRONMENT VARIABLES</h4> 77 <blockquote> 78 <p>The following environment variables shall affect the execution of <i>tsort</i>:</p> 79 <dl compact> 80 <dd></dd> 81 <dt><i>LANG</i></dt> 82 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 83 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 84 variables used to determine the values of locale categories.)</dd> 85 <dt><i>LC_ALL</i></dt> 86 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 87 <dt><i>LC_CTYPE</i></dt> 88 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 89 opposed to multi-byte characters in arguments and input files).</dd> 90 <dt><i>LC_MESSAGES</i></dt> 91 <dd><br> 92 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</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 </dl> 98 </blockquote> 99 <h4 class="mansect"><a name="tag_20_128_09" id="tag_20_128_09"></a>ASYNCHRONOUS EVENTS</h4> 100 <blockquote> 101 <p>Default.</p> 102 </blockquote> 103 <h4 class="mansect"><a name="tag_20_128_10" id="tag_20_128_10"></a>STDOUT</h4> 104 <blockquote> 105 <p>The standard output shall be a text file consisting of the ordered list of items, with one item per line, produced from the 106 partially ordered input.</p> 107 </blockquote> 108 <h4 class="mansect"><a name="tag_20_128_11" id="tag_20_128_11"></a>STDERR</h4> 109 <blockquote> 110 <p>The standard error shall be used only for diagnostic and warning messages.</p> 111 </blockquote> 112 <h4 class="mansect"><a name="tag_20_128_12" id="tag_20_128_12"></a>OUTPUT FILES</h4> 113 <blockquote> 114 <p>None.</p> 115 </blockquote> 116 <h4 class="mansect"><a name="tag_20_128_13" id="tag_20_128_13"></a>EXTENDED DESCRIPTION</h4> 117 <blockquote> 118 <p>None.</p> 119 </blockquote> 120 <h4 class="mansect"><a name="tag_20_128_14" id="tag_20_128_14"></a>EXIT STATUS</h4> 121 <blockquote> 122 <p>The following exit values shall be returned:</p> 123 <dl compact> 124 <dd></dd> 125 <dt> 0</dt> 126 <dd>Successful completion.</dd> 127 <dt>>0</dt> 128 <dd>An error occurred. If the <b>-w</b> option is specified and one or more cycles were found in the input, the exit status shall 129 be the number of cycles found, or an implementation-defined maximum if more cycles than that maximum were found.</dd> 130 </dl> 131 </blockquote> 132 <h4 class="mansect"><a name="tag_20_128_15" id="tag_20_128_15"></a>CONSEQUENCES OF ERRORS</h4> 133 <blockquote> 134 <p>Default.</p> 135 </blockquote> 136 <hr> 137 <div class="box"><em>The following sections are informative.</em></div> 138 <h4 class="mansect"><a name="tag_20_128_16" id="tag_20_128_16"></a>APPLICATION USAGE</h4> 139 <blockquote> 140 <p>The <i>LC_COLLATE</i> variable need not affect the actions of <i>tsort</i>. The output ordering is not lexicographic, but 141 depends on the pairs of items given as input.</p> 142 </blockquote> 143 <h4 class="mansect"><a name="tag_20_128_17" id="tag_20_128_17"></a>EXAMPLES</h4> 144 <blockquote> 145 <p>The command:</p> 146 <pre> 147 <tt>tsort <<EOF 148 a b c c d e 149 g g 150 f g e f 151 h h 152 EOF 153 </tt></pre> 154 <p>produces the output:</p> 155 <pre> 156 <b>a 157 b 158 c 159 d 160 e 161 f 162 g 163 h</b><tt> 164 </tt></pre></blockquote> 165 <h4 class="mansect"><a name="tag_20_128_18" id="tag_20_128_18"></a>RATIONALE</h4> 166 <blockquote> 167 <p>At the time that the <b>-w</b> option was added to this standard, the only known implementation reported a maximum of 255 cycles 168 via the exit status. This has the drawback that applications cannot distinguish, from the exit status, errors caused by cycles from 169 other errors or (when <i>tsort</i> is executed from a shell) termination by a signal. Implementations are urged to set the 170 implementation-defined maximum number of cycles reported via the exit status to at most 124, leaving values above that maximum 171 through 125 for other errors, and leaving values 126 and greater to have the special meanings that the shell assigns to them.</p> 172 </blockquote> 173 <h4 class="mansect"><a name="tag_20_128_19" id="tag_20_128_19"></a>FUTURE DIRECTIONS</h4> 174 <blockquote> 175 <p>A future version of this standard may require that when the <b>-w</b> option is specified, the maximum number of cycles reported 176 through the exit status of <i>tsort</i> is at most 124 and that exit status values greater than 126 are not used by 177 <i>tsort</i>.</p> 178 </blockquote> 179 <h4 class="mansect"><a name="tag_20_128_20" id="tag_20_128_20"></a>SEE ALSO</h4> 180 <blockquote> 181 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a></p> 182 </blockquote> 183 <h4 class="mansect"><a name="tag_20_128_21" id="tag_20_128_21"></a>CHANGE HISTORY</h4> 184 <blockquote> 185 <p>First released in Issue 2.</p> 186 </blockquote> 187 <h4 class="mansect"><a name="tag_20_128_22" id="tag_20_128_22"></a>Issue 6</h4> 188 <blockquote> 189 <p>The normative text is reworded to avoid use of the term "must" for application requirements.</p> 190 </blockquote> 191 <h4 class="mansect"><a name="tag_20_128_23" id="tag_20_128_23"></a>Issue 7</h4> 192 <blockquote> 193 <p>Austin Group Interpretation 1003.1-2001 #092 is applied.</p> 194 <p>The <i>tsort</i> utility is moved from the XSI option to the Base.</p> 195 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0146 [241] is applied.</p> 196 </blockquote> 197 <h4 class="mansect"><a name="tag_20_128_24" id="tag_20_128_24"></a>Issue 8</h4> 198 <blockquote> 199 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 200 <p>Austin Group Defects 1617 and 1629 are applied, clarifying how <i>tsort</i> handles cycles found in the input.</p> 201 <p>Austin Group Defect 1745 is applied, clarifying the input separator characters and the output format.</p> 202 </blockquote> 203 <div class="box"><em>End of informative text.</em></div> 204 <hr> 205 <p> </p> 206 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 207 <hr size="2" noshade> 208 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 209 POSIX™ is a Trademark of The IEEE.<br> 210 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 211 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 212 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 213 ]</font></center> 214 <hr size="2" noshade> 215 <div class="NAVHEADER"> 216 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 217 <tr class="nav"> 218 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/true.html" accesskey="P"><<< 219 Previous</a></td> 220 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 221 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/tty.html" accesskey="N">Next >>></a></td> 222 </tr> 223 </table> 224 <hr align="left" width="100%"></div> 225 </body> 226 </html>