Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
expand.html (11647B)
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>expand</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/ex.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/expr.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="expand" id="expand"></a> <a name="tag_20_41" id="tag_20_41"></a><!-- expand --> 28 <h4 class="mansect"><a name="tag_20_41_01" id="tag_20_41_01"></a>NAME</h4> 29 <blockquote>expand — convert tabs to spaces</blockquote> 30 <h4 class="mansect"><a name="tag_20_41_02" id="tag_20_41_02"></a>SYNOPSIS</h4> 31 <blockquote class="synopsis"> 32 <p><code><tt>expand</tt> <b>[</b><tt>-t</tt> <i>tablist</i><b>] [</b><i>file</i><tt>...</tt><b>]</b></code></p> 33 </blockquote> 34 <h4 class="mansect"><a name="tag_20_41_03" id="tag_20_41_03"></a>DESCRIPTION</h4> 35 <blockquote> 36 <p>The <i>expand</i> utility shall write files or the standard input to the standard output with <tab> characters replaced 37 with one or more <space> characters needed to pad to the next tab stop. Any <backspace> characters shall be copied to 38 the output and cause the column position count for tab stop calculations to be decremented; the column position count shall not be 39 decremented below zero.</p> 40 </blockquote> 41 <h4 class="mansect"><a name="tag_20_41_04" id="tag_20_41_04"></a>OPTIONS</h4> 42 <blockquote> 43 <p>The <i>expand</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 44 Guidelines</i></a> .</p> 45 <p>The following option shall be supported:</p> 46 <dl compact> 47 <dd></dd> 48 <dt><b>-t </b><i>tablist</i></dt> 49 <dd>Specify the tab stops. The application shall ensure that the argument <i>tablist</i> consists of either a single positive 50 decimal integer or a list of tabstops. If a single number is given, tabs shall be set that number of column positions apart instead 51 of the default 8. 52 <p>If a list of tabstops is given, the application shall ensure that it consists of a list of two or more positive decimal 53 integers, separated by <blank> or <comma> characters, in ascending order. The <tab> characters shall be set at 54 those specific column positions. Each tab stop <i>N</i> shall be an integer value greater than zero, and the list is in strictly 55 ascending order. This is taken to mean that, from the start of a line of output, tabbing to position <i>N</i> shall cause the next 56 character output to be in the (<i>N</i>+1)th column position on that line.</p> 57 <p>In the event of <i>expand</i> having to process a <tab> at a position beyond the last of those specified in a multiple 58 tab-stop list, the <tab> shall be replaced by a single <space> in the output.</p> 59 </dd> 60 </dl> 61 </blockquote> 62 <h4 class="mansect"><a name="tag_20_41_05" id="tag_20_41_05"></a>OPERANDS</h4> 63 <blockquote> 64 <p>The following operand shall be supported:</p> 65 <dl compact> 66 <dd></dd> 67 <dt><i>file</i></dt> 68 <dd>The pathname of a text file to be used as input.</dd> 69 </dl> 70 </blockquote> 71 <h4 class="mansect"><a name="tag_20_41_06" id="tag_20_41_06"></a>STDIN</h4> 72 <blockquote> 73 <p>See the INPUT FILES section.</p> 74 </blockquote> 75 <h4 class="mansect"><a name="tag_20_41_07" id="tag_20_41_07"></a>INPUT FILES</h4> 76 <blockquote> 77 <p>Input files shall be text files.</p> 78 </blockquote> 79 <h4 class="mansect"><a name="tag_20_41_08" id="tag_20_41_08"></a>ENVIRONMENT VARIABLES</h4> 80 <blockquote> 81 <p>The following environment variables shall affect the execution of <i>expand</i>:</p> 82 <dl compact> 83 <dd></dd> 84 <dt><i>LANG</i></dt> 85 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 86 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 87 variables used to determine the values of locale categories.)</dd> 88 <dt><i>LC_ALL</i></dt> 89 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 90 <dt><i>LC_CTYPE</i></dt> 91 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 92 opposed to multi-byte characters in arguments and input files), the processing of <tab> and <space> characters, and for 93 the determination of the width in column positions each character would occupy on an output device.</dd> 94 <dt><i>LC_MESSAGES</i></dt> 95 <dd><br> 96 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 97 <dt><i>NLSPATH</i></dt> 98 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 99 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 100 "0"></dd> 101 </dl> 102 </blockquote> 103 <h4 class="mansect"><a name="tag_20_41_09" id="tag_20_41_09"></a>ASYNCHRONOUS EVENTS</h4> 104 <blockquote> 105 <p>Default.</p> 106 </blockquote> 107 <h4 class="mansect"><a name="tag_20_41_10" id="tag_20_41_10"></a>STDOUT</h4> 108 <blockquote> 109 <p>The standard output shall be equivalent to the input files with <tab> characters converted into the appropriate number of 110 <space> characters.</p> 111 </blockquote> 112 <h4 class="mansect"><a name="tag_20_41_11" id="tag_20_41_11"></a>STDERR</h4> 113 <blockquote> 114 <p>The standard error shall be used only for diagnostic messages.</p> 115 </blockquote> 116 <h4 class="mansect"><a name="tag_20_41_12" id="tag_20_41_12"></a>OUTPUT FILES</h4> 117 <blockquote> 118 <p>None.</p> 119 </blockquote> 120 <h4 class="mansect"><a name="tag_20_41_13" id="tag_20_41_13"></a>EXTENDED DESCRIPTION</h4> 121 <blockquote> 122 <p>None.</p> 123 </blockquote> 124 <h4 class="mansect"><a name="tag_20_41_14" id="tag_20_41_14"></a>EXIT STATUS</h4> 125 <blockquote> 126 <p>The following exit values shall be returned:</p> 127 <dl compact> 128 <dd></dd> 129 <dt> 0</dt> 130 <dd>Successful completion</dd> 131 <dt>>0</dt> 132 <dd>An error occurred.</dd> 133 </dl> 134 </blockquote> 135 <h4 class="mansect"><a name="tag_20_41_15" id="tag_20_41_15"></a>CONSEQUENCES OF ERRORS</h4> 136 <blockquote> 137 <p>The <i>expand</i> utility shall terminate with an error message and non-zero exit status upon encountering difficulties 138 accessing one of the <i>file</i> operands.</p> 139 </blockquote> 140 <hr> 141 <div class="box"><em>The following sections are informative.</em></div> 142 <h4 class="mansect"><a name="tag_20_41_16" id="tag_20_41_16"></a>APPLICATION USAGE</h4> 143 <blockquote> 144 <p>None.</p> 145 </blockquote> 146 <h4 class="mansect"><a name="tag_20_41_17" id="tag_20_41_17"></a>EXAMPLES</h4> 147 <blockquote> 148 <p>None.</p> 149 </blockquote> 150 <h4 class="mansect"><a name="tag_20_41_18" id="tag_20_41_18"></a>RATIONALE</h4> 151 <blockquote> 152 <p>The <i>expand</i> utility is useful for preprocessing text files (before sorting, looking at specific columns, and so on) that 153 contain <tab> characters.</p> 154 <p>See XBD <a href="../basedefs/V1_chap03.html#tag_03_75"><i>3.75 Column Position</i></a> .</p> 155 <p>The <i>tablist</i> option-argument consists of integers in ascending order. Utility Syntax Guideline 8 mandates that 156 <i>expand</i> shall accept the integers (within the single argument) separated using either <comma> or <blank> 157 characters.</p> 158 <p>Earlier versions of this standard allowed the following form in the SYNOPSIS:</p> 159 <pre> 160 <tt>expand </tt><b>[</b><tt>-tabstop</tt><b>][</b><tt>-tab1,tab2,...,tabn</tt><b>][</b><i>file</i><tt> ...</tt><b>]</b><tt> 161 </tt></pre> 162 <p>This form is no longer specified by POSIX.1-2024 but may be present in some implementations.</p> 163 </blockquote> 164 <h4 class="mansect"><a name="tag_20_41_19" id="tag_20_41_19"></a>FUTURE DIRECTIONS</h4> 165 <blockquote> 166 <p>None.</p> 167 </blockquote> 168 <h4 class="mansect"><a name="tag_20_41_20" id="tag_20_41_20"></a>SEE ALSO</h4> 169 <blockquote> 170 <p><a href="../utilities/tabs.html#"><i>tabs</i></a> , <a href="../utilities/unexpand.html#"><i>unexpand</i></a></p> 171 <p>XBD <a href="../basedefs/V1_chap03.html#tag_03_75"><i>3.75 Column Position</i></a> , <a href= 172 "../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 173 Utility Syntax Guidelines</i></a></p> 174 </blockquote> 175 <h4 class="mansect"><a name="tag_20_41_21" id="tag_20_41_21"></a>CHANGE HISTORY</h4> 176 <blockquote> 177 <p>First released in Issue 4.</p> 178 </blockquote> 179 <h4 class="mansect"><a name="tag_20_41_22" id="tag_20_41_22"></a>Issue 6</h4> 180 <blockquote> 181 <p>This utility is marked as part of the User Portability Utilities option.</p> 182 <p>The APPLICATION USAGE section is added.</p> 183 <p>The obsolescent SYNOPSIS is removed.</p> 184 <p>The <i>LC_CTYPE</i> environment variable description is updated to align with the IEEE P1003.2b draft standard.</p> 185 <p>The normative text is reworded to avoid use of the term "must" for application requirements.</p> 186 </blockquote> 187 <h4 class="mansect"><a name="tag_20_41_23" id="tag_20_41_23"></a>Issue 7</h4> 188 <blockquote> 189 <p>Austin Group Interpretation 1003.1-2001 #027 is applied.</p> 190 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p> 191 <p>The <i>expand</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an 192 option for interactive utilities.</p> 193 </blockquote> 194 <h4 class="mansect"><a name="tag_20_41_24" id="tag_20_41_24"></a>Issue 8</h4> 195 <blockquote> 196 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 197 </blockquote> 198 <div class="box"><em>End of informative text.</em></div> 199 <hr> 200 <p> </p> 201 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 202 <hr size="2" noshade> 203 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 204 POSIX™ is a Trademark of The IEEE.<br> 205 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 206 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 207 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 208 ]</font></center> 209 <hr size="2" noshade> 210 <div class="NAVHEADER"> 211 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 212 <tr class="nav"> 213 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/ex.html" accesskey="P"><<< 214 Previous</a></td> 215 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 216 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/expr.html" accesskey="N">Next >>></a></td> 217 </tr> 218 </table> 219 <hr align="left" width="100%"></div> 220 </body> 221 </html>