Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
unexpand.html (12798B)
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>unexpand</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/uncompress.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/unget.html" accesskey="N">Next 19 >>></a></td> 20 </tr> 21 </table> 22 <hr align="left" width="100%"></div> 23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 24 <center><font size="2">The Open Group Base Specifications Issue 8<br> 25 IEEE Std 1003.1-2024<br> 26 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 27 <hr size="2" noshade> 28 <a name="top" id="top"></a> <a name="unexpand" id="unexpand"></a> <a name="tag_20_136" id="tag_20_136"></a><!-- unexpand --> 29 <h4 class="mansect"><a name="tag_20_136_01" id="tag_20_136_01"></a>NAME</h4> 30 <blockquote>unexpand — convert spaces to tabs</blockquote> 31 <h4 class="mansect"><a name="tag_20_136_02" id="tag_20_136_02"></a>SYNOPSIS</h4> 32 <blockquote class="synopsis"> 33 <p><code><tt>unexpand</tt> <b>[</b><tt>-a|-t</tt> <i>tablist</i><b>] [</b><i>file</i><tt>...</tt><b>]</b></code></p> 34 </blockquote> 35 <h4 class="mansect"><a name="tag_20_136_03" id="tag_20_136_03"></a>DESCRIPTION</h4> 36 <blockquote> 37 <p>The <i>unexpand</i> utility shall copy files or standard input to standard output, converting <blank> characters at the 38 beginning of each line into the maximum number of <tab> characters followed by the minimum number of <space> characters 39 needed to fill the same column positions originally filled by the translated <blank> characters. By default, tabstops shall 40 be set at every eighth column position. Each <backspace> shall be copied to the output, and shall cause the column position 41 count for tab calculations to be decremented; the count shall never be decremented to a value less than one.</p> 42 </blockquote> 43 <h4 class="mansect"><a name="tag_20_136_04" id="tag_20_136_04"></a>OPTIONS</h4> 44 <blockquote> 45 <p>The <i>unexpand</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 46 Guidelines</i></a> .</p> 47 <p>The following options shall be supported:</p> 48 <dl compact> 49 <dd></dd> 50 <dt><b>-a</b></dt> 51 <dd>In addition to translating <blank> characters at the beginning of each line, translate all sequences of two or more 52 <blank> characters immediately preceding a tab stop to the maximum number of <tab> characters followed by the minimum 53 number of <space> characters needed to fill the same column positions originally filled by the translated <blank> 54 characters.</dd> 55 <dt><b>-t </b><i>tablist</i></dt> 56 <dd>Specify the tab stops. The application shall ensure that the <i>tablist</i> option-argument is a single argument consisting of 57 a single positive decimal integer or multiple positive decimal integers, separated by <blank> or <comma> characters, in 58 ascending order. If a single number is given, tabs shall be set <i>tablist</i> column positions apart instead of the default 8. If 59 multiple numbers are given, the tabs shall be set at those specific column positions. 60 <p>The application shall ensure that each tab-stop position <i>N</i> is an integer value greater than zero, and the list shall be 61 in strictly ascending order. This is taken to mean that, from the start of a line of output, tabbing to position <i>N</i> shall 62 cause the next character output to be in the (<i>N</i>+1)th column position on that line. When the <b>-t</b> option is not 63 specified, the default shall be the equivalent of specifying <b>-t 8</b> (except for the interaction with <b>-a</b>, described 64 below).</p> 65 <p>No <space>-to-<tab> conversions shall occur for characters at positions beyond the last of those specified in a 66 multiple tab-stop list.</p> 67 <p>When <b>-t</b> is specified, the presence or absence of the <b>-a</b> option shall be ignored; conversion shall not be limited 68 to the processing of leading <blank> characters.</p> 69 </dd> 70 </dl> 71 </blockquote> 72 <h4 class="mansect"><a name="tag_20_136_05" id="tag_20_136_05"></a>OPERANDS</h4> 73 <blockquote> 74 <p>The following operand shall be supported:</p> 75 <dl compact> 76 <dd></dd> 77 <dt><i>file</i></dt> 78 <dd>A pathname of a text file to be used as input.</dd> 79 </dl> 80 </blockquote> 81 <h4 class="mansect"><a name="tag_20_136_06" id="tag_20_136_06"></a>STDIN</h4> 82 <blockquote> 83 <p>See the INPUT FILES section.</p> 84 </blockquote> 85 <h4 class="mansect"><a name="tag_20_136_07" id="tag_20_136_07"></a>INPUT FILES</h4> 86 <blockquote> 87 <p>The input files shall be text files.</p> 88 </blockquote> 89 <h4 class="mansect"><a name="tag_20_136_08" id="tag_20_136_08"></a>ENVIRONMENT VARIABLES</h4> 90 <blockquote> 91 <p>The following environment variables shall affect the execution of <i>unexpand</i>:</p> 92 <dl compact> 93 <dd></dd> 94 <dt><i>LANG</i></dt> 95 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 96 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 97 variables used to determine the values of locale categories.)</dd> 98 <dt><i>LC_ALL</i></dt> 99 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 100 <dt><i>LC_CTYPE</i></dt> 101 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 102 opposed to multi-byte characters in arguments and input files), the processing of <tab> and <space> characters, and for 103 the determination of the width in column positions each character would occupy on an output device.</dd> 104 <dt><i>LC_MESSAGES</i></dt> 105 <dd><br> 106 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 107 <dt><i>NLSPATH</i></dt> 108 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 109 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 110 "0"></dd> 111 </dl> 112 </blockquote> 113 <h4 class="mansect"><a name="tag_20_136_09" id="tag_20_136_09"></a>ASYNCHRONOUS EVENTS</h4> 114 <blockquote> 115 <p>Default.</p> 116 </blockquote> 117 <h4 class="mansect"><a name="tag_20_136_10" id="tag_20_136_10"></a>STDOUT</h4> 118 <blockquote> 119 <p>The standard output shall be equivalent to the input files with the specified <space>-to-<tab> conversions.</p> 120 </blockquote> 121 <h4 class="mansect"><a name="tag_20_136_11" id="tag_20_136_11"></a>STDERR</h4> 122 <blockquote> 123 <p>The standard error shall be used only for diagnostic messages.</p> 124 </blockquote> 125 <h4 class="mansect"><a name="tag_20_136_12" id="tag_20_136_12"></a>OUTPUT FILES</h4> 126 <blockquote> 127 <p>None.</p> 128 </blockquote> 129 <h4 class="mansect"><a name="tag_20_136_13" id="tag_20_136_13"></a>EXTENDED DESCRIPTION</h4> 130 <blockquote> 131 <p>None.</p> 132 </blockquote> 133 <h4 class="mansect"><a name="tag_20_136_14" id="tag_20_136_14"></a>EXIT STATUS</h4> 134 <blockquote> 135 <p>The following exit values shall be returned:</p> 136 <dl compact> 137 <dd></dd> 138 <dt> 0</dt> 139 <dd>Successful completion.</dd> 140 <dt>>0</dt> 141 <dd>An error occurred.</dd> 142 </dl> 143 </blockquote> 144 <h4 class="mansect"><a name="tag_20_136_15" id="tag_20_136_15"></a>CONSEQUENCES OF ERRORS</h4> 145 <blockquote> 146 <p>Default.</p> 147 </blockquote> 148 <hr> 149 <div class="box"><em>The following sections are informative.</em></div> 150 <h4 class="mansect"><a name="tag_20_136_16" id="tag_20_136_16"></a>APPLICATION USAGE</h4> 151 <blockquote> 152 <p>One non-intuitive aspect of <i>unexpand</i> is its restriction to leading <space> characters when neither <b>-a</b> nor 153 <b>-t</b> is specified. Users who always want to convert all <space> characters in a file can easily alias <i>unexpand</i> to 154 use the <b>-a</b> or <b>-t 8</b> option.</p> 155 </blockquote> 156 <h4 class="mansect"><a name="tag_20_136_17" id="tag_20_136_17"></a>EXAMPLES</h4> 157 <blockquote> 158 <p>None.</p> 159 </blockquote> 160 <h4 class="mansect"><a name="tag_20_136_18" id="tag_20_136_18"></a>RATIONALE</h4> 161 <blockquote> 162 <p>On several occasions, consideration was given to adding a <b>-t</b> option to the <i>unexpand</i> utility to complement the 163 <b>-t</b> in <a href="../utilities/expand.html"><i>expand</i></a> (see <a href="../utilities/expand.html#"><i>expand</i></a> ). The 164 historical intent of <i>unexpand</i> was to translate multiple <blank> characters into tab stops, where tab stops were a 165 multiple of eight column positions on most UNIX systems. An early proposal omitted <b>-t</b> because it seemed outside the scope of 166 the User Portability Utilities option; it was not described in any of the base documents for IEEE Std 1003.2-1992. 167 However, hard-coding tab stops every eight columns was not suitable for the international community and broke historical precedents 168 for some vendors in the FORTRAN community, so <b>-t</b> was restored in conjunction with the list of valid extension categories 169 considered by the standard developers. Thus, <i>unexpand</i> is now the logical converse of <a href= 170 "../utilities/expand.html"><i>expand</i></a>.</p> 171 </blockquote> 172 <h4 class="mansect"><a name="tag_20_136_19" id="tag_20_136_19"></a>FUTURE DIRECTIONS</h4> 173 <blockquote> 174 <p>None.</p> 175 </blockquote> 176 <h4 class="mansect"><a name="tag_20_136_20" id="tag_20_136_20"></a>SEE ALSO</h4> 177 <blockquote> 178 <p><a href="../utilities/expand.html#"><i>expand</i></a> , <a href="../utilities/tabs.html#"><i>tabs</i></a></p> 179 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 180 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p> 181 </blockquote> 182 <h4 class="mansect"><a name="tag_20_136_21" id="tag_20_136_21"></a>CHANGE HISTORY</h4> 183 <blockquote> 184 <p>First released in Issue 4.</p> 185 </blockquote> 186 <h4 class="mansect"><a name="tag_20_136_22" id="tag_20_136_22"></a>Issue 6</h4> 187 <blockquote> 188 <p>This utility is marked as part of the User Portability Utilities option.</p> 189 <p>The definition of the <i>LC_CTYPE</i> environment variable is changed to align with the IEEE P1003.2b draft standard.</p> 190 <p>The normative text is reworded to avoid use of the term "must" for application requirements.</p> 191 </blockquote> 192 <h4 class="mansect"><a name="tag_20_136_23" id="tag_20_136_23"></a>Issue 7</h4> 193 <blockquote> 194 <p>The <i>unexpand</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now 195 an option for interactive utilities.</p> 196 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p> 197 <p>POSIX.1-2008, Technical Corrigendum 2, XCU/TC2-2008/0198 [885] is applied.</p> 198 </blockquote> 199 <h4 class="mansect"><a name="tag_20_136_24" id="tag_20_136_24"></a>Issue 8</h4> 200 <blockquote> 201 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></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/uncompress.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/unget.html" accesskey="N">Next 222 >>></a></td> 223 </tr> 224 </table> 225 <hr align="left" width="100%"></div> 226 </body> 227 </html>