isposix

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

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

sed.html (47971B)


      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>sed</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/sccs.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/sh.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="sed" id="sed"></a> <a name="tag_20_109" id="tag_20_109"></a><!-- sed -->
     28 <h4 class="mansect"><a name="tag_20_109_01" id="tag_20_109_01"></a>NAME</h4>
     29 <blockquote>sed — stream editor</blockquote>
     30 <h4 class="mansect"><a name="tag_20_109_02" id="tag_20_109_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <p><code><tt>sed</tt> <b>[</b><tt>-En</tt><b>]</b> <i>script</i> <b>[</b><i>file</i><tt>...</tt><b>]</b> <tt><br>
     33 <br>
     34 sed</tt> <b>[</b><tt>-En</tt><b>]</b> <tt>-e</tt> <i>script</i> <b>[</b><tt>-e</tt> <i>script</i><b>]</b><tt>...</tt>
     35 <b>[</b><tt>-f</tt> <i>script_file</i><b>]</b><tt>...</tt> <b>[</b><i>file</i><tt>...</tt><b>]</b> <tt><br>
     36 <br>
     37 sed</tt> <b>[</b><tt>-En</tt><b>] [</b><tt>-e</tt> <i>script</i><b>]</b><tt>... -f</tt> <i>script_file</i> <b>[</b><tt>-f</tt>
     38 <i>script_file</i><b>]</b><tt>...</tt> <b>[</b><i>file</i><tt>...</tt><b>]</b> <tt><br></tt></code></p>
     39 </blockquote>
     40 <h4 class="mansect"><a name="tag_20_109_03" id="tag_20_109_03"></a>DESCRIPTION</h4>
     41 <blockquote>
     42 <p>The <i>sed</i> utility is a stream editor that shall read one or more text files, make editing changes according to a script of
     43 editing commands, and write the results to standard output. The script shall be obtained from either the <i>script</i> operand
     44 string or a combination of the option-arguments from the <b>-e</b> <i>script</i> and <b>-f</b> <i>script_file</i> options.</p>
     45 </blockquote>
     46 <h4 class="mansect"><a name="tag_20_109_04" id="tag_20_109_04"></a>OPTIONS</h4>
     47 <blockquote>
     48 <p>The <i>sed</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     49 Guidelines</i></a> , except that the order of presentation of the <b>-e</b> and <b>-f</b> options is significant.</p>
     50 <p>The following options shall be supported:</p>
     51 <dl compact>
     52 <dd></dd>
     53 <dt><b>-E</b></dt>
     54 <dd>Match using extended regular expressions. Treat each pattern specified as an ERE, as described in XBD <a href=
     55 "../basedefs/V1_chap09.html#tag_09_04"><i>9.4 Extended Regular Expressions</i></a> .</dd>
     56 <dt><b>-e&nbsp;</b><i>script</i></dt>
     57 <dd>Add the editing commands specified by the <i>script</i> option-argument to the end of the script of editing commands.</dd>
     58 <dt><b>-f&nbsp;</b><i>script_file</i></dt>
     59 <dd>Add the editing commands in the file <i>script_file</i> to the end of the script of editing commands.</dd>
     60 <dt><b>-n</b></dt>
     61 <dd>Suppress the default output (in which each line, after it is examined for editing, is written to standard output). Only lines
     62 explicitly selected for output are written.</dd>
     63 </dl>
     64 <p>If any <b>-e</b> or <b>-f</b> options are specified, the script of editing commands shall initially be empty. The commands
     65 specified by each <b>-e</b> or <b>-f</b> option shall be added to the script in the order specified. When each addition is made, if
     66 the previous addition (if any) was from a <b>-e</b> option, a &lt;newline&gt; shall be inserted before the new addition. The
     67 resulting script shall have the same properties as the <i>script</i> operand, described in the OPERANDS section.</p>
     68 </blockquote>
     69 <h4 class="mansect"><a name="tag_20_109_05" id="tag_20_109_05"></a>OPERANDS</h4>
     70 <blockquote>
     71 <p>The following operands shall be supported:</p>
     72 <dl compact>
     73 <dd></dd>
     74 <dt><i>file</i></dt>
     75 <dd>A pathname of a file whose contents are read and edited. If multiple <i>file</i> operands are specified, the named files shall
     76 be read in the order specified and the concatenation shall be edited. If no <i>file</i> operands are specified, the standard input
     77 shall be used.</dd>
     78 <dt><i>script</i></dt>
     79 <dd>A string to be used as the script of editing commands. The application shall not present a <i>script</i> that violates the
     80 restrictions of a text file except that the final character need not be a &lt;newline&gt;.</dd>
     81 </dl>
     82 </blockquote>
     83 <h4 class="mansect"><a name="tag_20_109_06" id="tag_20_109_06"></a>STDIN</h4>
     84 <blockquote>
     85 <p>The standard input shall be used if no <i>file</i> operands are specified, and shall be used if a <i>file</i> operand is
     86 <tt>'-'</tt> and the implementation treats the <tt>'-'</tt> as meaning standard input. Otherwise, the standard input shall not be
     87 used. See the INPUT FILES section.</p>
     88 </blockquote>
     89 <h4 class="mansect"><a name="tag_20_109_07" id="tag_20_109_07"></a>INPUT FILES</h4>
     90 <blockquote>
     91 <p>The input files shall be text files. The <i>script_file</i>s named by the <b>-f</b> option shall consist of editing
     92 commands.</p>
     93 </blockquote>
     94 <h4 class="mansect"><a name="tag_20_109_08" id="tag_20_109_08"></a>ENVIRONMENT VARIABLES</h4>
     95 <blockquote>
     96 <p>The following environment variables shall affect the execution of <i>sed</i>:</p>
     97 <dl compact>
     98 <dd></dd>
     99 <dt><i>LANG</i></dt>
    100 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
    101 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
    102 variables used to determine the values of locale categories.)</dd>
    103 <dt><i>LC_ALL</i></dt>
    104 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
    105 <dt><i>LC_COLLATE</i></dt>
    106 <dd><br>
    107 Determine the locale for the behavior of ranges, equivalence classes, and multi-character collating elements within regular
    108 expressions.</dd>
    109 <dt><i>LC_CTYPE</i></dt>
    110 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    111 opposed to multi-byte characters in arguments and input files), and the behavior of character classes within regular
    112 expressions.</dd>
    113 <dt><i>LC_MESSAGES</i></dt>
    114 <dd><br>
    115 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
    116 <dt><i>NLSPATH</i></dt>
    117 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    118 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
    119 "0"></dd>
    120 </dl>
    121 </blockquote>
    122 <h4 class="mansect"><a name="tag_20_109_09" id="tag_20_109_09"></a>ASYNCHRONOUS EVENTS</h4>
    123 <blockquote>
    124 <p>Default.</p>
    125 </blockquote>
    126 <h4 class="mansect"><a name="tag_20_109_10" id="tag_20_109_10"></a>STDOUT</h4>
    127 <blockquote>
    128 <p>The input files shall be written to standard output, with the editing commands specified in the script applied. If the <b>-n</b>
    129 option is specified, only those input lines selected by the script shall be written to standard output.</p>
    130 </blockquote>
    131 <h4 class="mansect"><a name="tag_20_109_11" id="tag_20_109_11"></a>STDERR</h4>
    132 <blockquote>
    133 <p>The standard error shall be used only for diagnostic and warning messages.</p>
    134 </blockquote>
    135 <h4 class="mansect"><a name="tag_20_109_12" id="tag_20_109_12"></a>OUTPUT FILES</h4>
    136 <blockquote>
    137 <p>The output files shall be text files whose formats are dependent on the editing commands given.</p>
    138 </blockquote>
    139 <h4 class="mansect"><a name="tag_20_109_13" id="tag_20_109_13"></a>EXTENDED DESCRIPTION</h4>
    140 <blockquote>
    141 <p>The <i>script</i> shall consist of editing commands of the following form:</p>
    142 <pre>
    143 <b>[</b><i>address</i><b>[</b><tt>,</tt><i>address</i><b>]]</b><i>function</i><tt>
    144 </tt></pre>
    145 <p>where <i>function</i> represents a single-character command verb from the list in <a href="#tag_20_109_13_03">Editing Commands
    146 in sed</a> , followed by any applicable arguments.</p>
    147 <p>The command can be preceded by &lt;blank&gt; characters and/or &lt;semicolon&gt; characters. The function can be preceded by
    148 &lt;blank&gt; characters. These optional characters shall have no effect.</p>
    149 <p>In default operation, <i>sed</i> cyclically shall append a line of input, less its terminating &lt;newline&gt; character, into
    150 the pattern space. Reading from input shall be skipped if a &lt;newline&gt; was in the pattern space prior to a <b>D</b> command
    151 ending the previous cycle. The <i>sed</i> utility shall then apply in sequence all commands whose addresses select that pattern
    152 space, until a command starts the next cycle or quits. If no commands explicitly started a new cycle, then at the end of the script
    153 the pattern space shall be copied to standard output (except when <b>-n</b> is specified) and the pattern space shall be deleted.
    154 Whenever the pattern space is written to standard output or a named file, <i>sed</i> shall immediately follow it with a
    155 &lt;newline&gt;.</p>
    156 <p>Some of the editing commands use a hold space to save all or part of the pattern space for subsequent retrieval. The pattern and
    157 hold spaces shall each be able to hold at least 8192 bytes.</p>
    158 <h5><a name="tag_20_109_13_01" id="tag_20_109_13_01"></a>Addresses in sed</h5>
    159 <p>An address is either a decimal number that counts input lines cumulatively across files, a <tt>'$'</tt> character that addresses
    160 the last line of input, or a context address. A context address has either the form <tt>"/RE/"</tt> or
    161 <tt>"\<i>c</i>RE<i>c</i>"</tt>, where RE is a regular expression as described in <a href="#tag_20_109_13_02">Regular Expressions in
    162 sed</a> , and <i>c</i> is any character other than &lt;backslash&gt; or &lt;newline&gt;. In a <i>sed</i> context address, the BRE
    163 and ERE syntax shall be extended to support escaping occurrences of the &lt;slash&gt; or <i>c</i> delimiter within the RE by means
    164 of an escape sequence (see XBD <a href="../basedefs/V1_chap09.html#tag_09_01"><i>9.1 Regular Expression Definitions</i></a> ). For
    165 the <tt>"\<i>c</i>RE<i>c</i>"</tt> form, if the character designated by <i>c</i> is not listed as a special BRE character (if the
    166 <b>-E</b> option is not specified) or a special ERE character (if <b>-E</b> is specified) in XBD <a href=
    167 "../basedefs/V1_chap09.html#tag_09_03_03"><i>9.3.3 BRE Special Characters</i></a> or XBD <a href=
    168 "../basedefs/V1_chap09.html#tag_09_04_03"><i>9.4.3 ERE Special Characters</i></a> , respectively, the escape sequence
    169 &lt;backslash&gt;<i>c</i> shall be treated as that literal character; otherwise, it is unspecified whether the escape sequence
    170 &lt;backslash&gt;<i>c</i> is treated as the literal character or the special character. In either case, the escape sequence
    171 &lt;backslash&gt;<i>c</i> shall not terminate the RE. For example, in the context address <tt>"/abc\/def/"</tt>, the second
    172 &lt;slash&gt; stands for itself, so that the RE is <tt>"abc/def"</tt>, and in <tt>"\xabc\xdefx"</tt>, the second <tt>'x'</tt>
    173 stands for itself, so that the RE is <tt>"abcxdef"</tt>.</p>
    174 <p>An editing command with no addresses shall select every pattern space.</p>
    175 <p>An editing command with one address shall select each pattern space that matches the address.</p>
    176 <p>An editing command with two addresses shall select the inclusive range from the first pattern space that matches the first
    177 address through the next pattern space that matches the second. (If the second address is a number less than or equal to the line
    178 number first selected, only one line shall be selected.) Starting at the first line following the selected range, <i>sed</i> shall
    179 look again for the first address. Thereafter, the process shall be repeated. Omitting either or both of the address components in
    180 the following form produces undefined results:</p>
    181 <pre>
    182 <b>[</b><i>address</i><b>[</b><tt>,</tt><i>address</i><b>]]</b><tt>
    183 </tt></pre>
    184 <h5><a name="tag_20_109_13_02" id="tag_20_109_13_02"></a>Regular Expressions in sed</h5>
    185 <p>The <i>sed</i> utility shall support the REs described in XBD <a href="../basedefs/V1_chap09.html#tag_09"><i>9. Regular
    186 Expressions</i></a> ; by default it shall use BREs as described in XBD <a href="../basedefs/V1_chap09.html#tag_09_03"><i>9.3 Basic
    187 Regular Expressions</i></a> , but if the <b>-E</b> option is used, it shall use EREs as described in XBD <a href=
    188 "../basedefs/V1_chap09.html#tag_09_04"><i>9.4 Extended Regular Expressions</i></a> . In <i>sed</i>, the BRE and ERE syntax shall be
    189 extended as follows:</p>
    190 <ul>
    191 <li>
    192 <p>The delimiter character that precedes and follows the RE shall not terminate the RE when it appears within a bracket expression,
    193 and shall have its normal meaning in the bracket expression. For example, the context address <tt>"\%[%]%"</tt> is equivalent to
    194 <tt>"/[%]/"</tt>, and the command <tt>"s-[0-9]--g"</tt> is equivalent to <tt>"s/[0-9]//g"</tt>.</p>
    195 </li>
    196 <li>
    197 <p>The escape sequence <tt>'\n'</tt> shall match a &lt;newline&gt; embedded in the pattern space. A literal &lt;newline&gt; shall
    198 not be used in the RE of a context address or in the substitute function.</p>
    199 </li>
    200 <li>
    201 <p>If an RE is empty (that is, no pattern is specified) <i>sed</i> shall behave as if the last RE used in the last command applied
    202 (either as an address or as part of a substitute command) was specified.</p>
    203 </li>
    204 </ul>
    205 <h5><a name="tag_20_109_13_03" id="tag_20_109_13_03"></a>Editing Commands in sed</h5>
    206 <p>In the following list of editing commands, the maximum number of permissible addresses for each function is indicated by
    207 [<i>0addr</i>], [<i>1addr</i>], or [<i>2addr</i>], representing zero, one, or two addresses.</p>
    208 <p>The argument <i>text</i> shall consist of one or more lines. A &lt;backslash&gt; in the text can be escaped with another
    209 &lt;backslash&gt;. The application shall ensure that each embedded &lt;newline&gt; (that is, those other than the terminating
    210 &lt;newline&gt; of the last line) in the text is preceded by an unescaped &lt;backslash&gt;. The behavior is unspecified if an
    211 unescaped &lt;backslash&gt; is immediately followed by any character other than &lt;backslash&gt; or &lt;newline&gt;, or by the end
    212 of a <i>script</i>.</p>
    213 <p>The <b>r</b> and <b>w</b> command verbs, and the <i>w</i> flag to the <b>s</b> command, take an <i>rfile</i> (or <i>wfile</i>)
    214 parameter, separated from the command verb letter or flag by one or more &lt;blank&gt; characters; implementations may allow zero
    215 separation as an extension.</p>
    216 <p>The argument <i>rfile</i> or the argument <i>wfile</i> shall terminate the editing command. Each <i>wfile</i> shall be created
    217 before processing begins. Implementations shall support at least ten <i>wfile</i> arguments in the script; the actual number
    218 (greater than or equal to 10) that is supported by the implementation is unspecified. The use of the <i>wfile</i> parameter shall
    219 cause that file to be initially created, if it does not exist, or shall replace the contents of an existing file.</p>
    220 <p>The <b>b</b>, <b>r</b>, <b>s</b>, <b>t</b>, <b>w</b>, <b>y</b>, and <b>:</b> command verbs shall accept additional arguments.
    221 The following synopses indicate which arguments shall be separated from the command verbs by a single &lt;space&gt;.</p>
    222 <p>The <b>a</b> and <b>r</b> commands schedule text for later output. The text specified for the <b>a</b> command, and the contents
    223 of the file specified for the <b>r</b> command, shall be written to standard output just before the next attempt to fetch a line of
    224 input when executing the <b>c</b>, <b>D</b>, <b>d</b>, <b>N</b>, or <b>n</b> commands, just before executing the <b>q</b> command,
    225 or when reaching the end of the script. If written when reaching the end of the script, and the <b>-n</b> option was not specified,
    226 the text shall be written after copying the pattern space to standard output. The contents of the file specified for the <b>r</b>
    227 command shall be as of the time the output is written, not the time the <b>r</b> command is applied. The text shall be output in
    228 the order in which the <b>a</b> and <b>r</b> commands were applied to the input.</p>
    229 <p>Editing commands other than <b>a</b>, <b>b</b>, <b>c</b>, <b>i</b>, <b>r</b>, <b>t</b>, <b>w</b>, <b>:</b>, and <b>#</b> can be
    230 followed by a &lt;semicolon&gt;, optional &lt;blank&gt; characters, and another editing command. However, when an <b>s</b> editing
    231 command is used with the <i>w</i> flag, following it with another command in this manner produces undefined results.</p>
    232 <p>A function can be preceded by a <tt>'!'</tt> character, in which case the function shall be applied if the addresses do not
    233 select the pattern space. Zero or more &lt;blank&gt; characters shall be accepted before the <tt>'!'</tt> character. It is
    234 unspecified whether &lt;blank&gt; characters can follow the <tt>'!'</tt> character, and conforming applications shall not follow
    235 the <tt>'!'</tt> character with &lt;blank&gt; characters.</p>
    236 <p>If a <i>label</i> argument (to a <b>b</b>, <b>t</b>, or <b>:</b> command) contains characters outside of the portable filename
    237 character set, or if a <i>label</i> is longer than 8 bytes, the behavior is unspecified. The implementation shall support
    238 <i>label</i> arguments recognized as unique up to at least 8 bytes; the actual length (greater than or equal to 8) supported by the
    239 implementation is unspecified. It is unspecified whether exceeding the maximum supported label length causes an error or a silent
    240 truncation.</p>
    241 <dl compact>
    242 <dd></dd>
    243 <dt><b>[</b><i>2addr</i><b>]&nbsp;{</b><i>editing command</i></dt>
    244 <dd></dd>
    245 <dt><i>editing command</i></dt>
    246 <dd></dd>
    247 <dt>...</dt>
    248 <dd></dd>
    249 <dt><b>}</b></dt>
    250 <dd>Execute a list of <i>sed</i> editing commands only when the pattern space is selected. The list of <i>sed</i> editing commands
    251 shall be surrounded by braces. The braces can be preceded or followed by &lt;blank&gt; characters. The &lt;right-brace&gt; shall be
    252 preceded by a &lt;newline&gt; or &lt;semicolon&gt; (before any optional &lt;blank&gt; characters preceding the
    253 &lt;right-brace&gt;).
    254 <p>Each command in the list of commands shall be terminated by a &lt;newline&gt; character, or by a &lt;semicolon&gt; character if
    255 permitted when the command is used outside the braces. The editing commands can be preceded by &lt;blank&gt; characters, but shall
    256 not be followed by &lt;blank&gt; characters.</p>
    257 </dd>
    258 <dt><b>[</b><i>1addr</i><b>]a\</b></dt>
    259 <dd></dd>
    260 <dt><i>text</i></dt>
    261 <dd>Write text to standard output as described previously.</dd>
    262 <dt><b>[</b><i>2addr</i><b>]b&nbsp;[</b><i>label</i><b>]</b></dt>
    263 <dd><br>
    264 Branch to the <b>:</b> command verb bearing the <i>label</i> argument. If <i>label</i> is not specified, branch to the end of the
    265 script.</dd>
    266 <dt><b>[</b><i>2addr</i><b>]c\</b></dt>
    267 <dd></dd>
    268 <dt><i>text</i></dt>
    269 <dd>Delete the pattern space. With a 0 or 1 address or at the end of a 2-address range, place <i>text</i> on the output. Start the
    270 next cycle.</dd>
    271 <dt><b>[</b><i>2addr</i><b>]d</b></dt>
    272 <dd>Delete the pattern space and start the next cycle.</dd>
    273 <dt><b>[</b><i>2addr</i><b>]D</b></dt>
    274 <dd>If the pattern space contains no &lt;newline&gt;, delete the pattern space and start a normal new cycle as if the <b>d</b>
    275 command was issued. Otherwise, delete the initial segment of the pattern space through the first &lt;newline&gt;, and start the
    276 next cycle with the resultant pattern space and without reading any new input.</dd>
    277 <dt><b>[</b><i>2addr</i><b>]g</b></dt>
    278 <dd>Replace the contents of the pattern space by the contents of the hold space.</dd>
    279 <dt><b>[</b><i>2addr</i><b>]G</b></dt>
    280 <dd>Append to the pattern space a &lt;newline&gt; followed by the contents of the hold space.</dd>
    281 <dt><b>[</b><i>2addr</i><b>]h</b></dt>
    282 <dd>Replace the contents of the hold space with the contents of the pattern space.</dd>
    283 <dt><b>[</b><i>2addr</i><b>]H</b></dt>
    284 <dd>Append to the hold space a &lt;newline&gt; followed by the contents of the pattern space.</dd>
    285 <dt><b>[</b><i>1addr</i><b>]i\</b></dt>
    286 <dd></dd>
    287 <dt><i>text</i></dt>
    288 <dd>Write <i>text</i> to standard output.</dd>
    289 <dt><b>[</b><i>2addr</i><b>]l</b></dt>
    290 <dd>(The letter ell.) Write the pattern space to standard output in a visually unambiguous form. The characters listed in XBD
    291 <a href="../basedefs/V1_chap05.html#tagtcjh_2"><i>Escape Sequences and Associated Actions</i></a> (<tt>'\\'</tt>, <tt>'\a'</tt>,
    292 <tt>'\b'</tt>, <tt>'\f'</tt>, <tt>'\r'</tt>, <tt>'\t'</tt>, <tt>'\v'</tt>) shall be written as the corresponding escape sequence;
    293 the <tt>'\n'</tt> in that table is not applicable. Non-printable characters not in that table shall be written as one three-digit
    294 octal number (with a preceding &lt;backslash&gt;) for each byte in the character (most significant byte first).
    295 <p>Long lines shall be folded, with the point of folding indicated by writing a &lt;backslash&gt; followed by a &lt;newline&gt;;
    296 the length at which folding occurs is unspecified, but should be appropriate for the output device. The end of each line shall be
    297 marked with a <tt>'$'</tt>.</p>
    298 </dd>
    299 <dt><b>[</b><i>2addr</i><b>]n</b></dt>
    300 <dd>Write the pattern space to standard output if the default output has not been suppressed, and replace the pattern space with
    301 the next line of input, less its terminating &lt;newline&gt;.
    302 <p>If no next line of input is available, the <b>n</b> command verb shall branch to the end of the script and quit without starting
    303 a new cycle.</p>
    304 </dd>
    305 <dt><b>[</b><i>2addr</i><b>]N</b></dt>
    306 <dd>Append the next line of input, less its terminating &lt;newline&gt;, to the pattern space, using an embedded &lt;newline&gt; to
    307 separate the appended material from the original material. Note that the current line number changes.
    308 <p>If no next line of input is available, the <b>N</b> command verb shall branch to the end of the script and quit without starting
    309 a new cycle or copying the pattern space to standard output.</p>
    310 </dd>
    311 <dt><b>[</b><i>2addr</i><b>]p</b></dt>
    312 <dd>Write the pattern space to standard output.</dd>
    313 <dt><b>[</b><i>2addr</i><b>]P</b></dt>
    314 <dd>Write the pattern space, up to the first &lt;newline&gt;, to standard output.</dd>
    315 <dt><b>[</b><i>1addr</i><b>]q</b></dt>
    316 <dd>Branch to the end of the script and quit without starting a new cycle.</dd>
    317 <dt><b>[</b><i>1addr</i><b>]r&nbsp;</b><i>rfile</i></dt>
    318 <dd>Copy the contents of <i>rfile</i> to standard output as described previously. If <i>rfile</i> does not exist or cannot be read,
    319 it shall be treated as if it were an empty file, causing no error condition.</dd>
    320 <dt><b>[</b><i>2addr</i><b>]s/</b><i>RE</i><b>/</b><i>replacement</i><b>/</b><i>flags</i></dt>
    321 <dd><br>
    322 Substitute the replacement string for instances of the RE in the pattern space. Any character other than &lt;backslash&gt; or
    323 &lt;newline&gt; can be used instead of a &lt;slash&gt; to delimit the RE and the replacement. Within the RE (as a <i>sed</i>
    324 extension to the BRE and ERE syntax) and the replacement, the delimiter shall not terminate the RE or replacement if it is the
    325 second character of an escape sequence (see XBD <a href="../basedefs/V1_chap09.html#tag_09_01"><i>9.1 Regular Expression
    326 Definitions</i></a> ). If the delimiter character is not listed as a special BRE character (if the <b>-E</b> option is not
    327 specified) or a special ERE character (if <b>-E</b> is specified) in XBD <a href="../basedefs/V1_chap09.html#tag_09_03_03"><i>9.3.3
    328 BRE Special Characters</i></a> or XBD <a href="../basedefs/V1_chap09.html#tag_09_04_03"><i>9.4.3 ERE Special Characters</i></a> ,
    329 respectively, the escaped delimiter shall be treated as that literal character in the RE; otherwise, it is unspecified whether the
    330 escaped delimiter is treated as the literal character or the special character. Likewise, if the delimiter character is not
    331 &lt;ampersand&gt; (<tt>'&amp;'</tt>), the escaped delimiter shall be treated as that literal character in the replacement; if it is
    332 &lt;ampersand&gt;, it is unspecified whether the escaped delimiter is treated as the literal character or the special character
    333 (see below).
    334 <p>The replacement string shall be scanned from beginning to end. An &lt;ampersand&gt; (<tt>'&amp;'</tt>) appearing in the
    335 replacement shall be replaced by the string matching the RE. The special meaning of <tt>'&amp;'</tt> in this context can be
    336 suppressed by preceding it by a &lt;backslash&gt;. The characters <tt>"\</tt><i>n"</i>, where <i>n</i> is a digit, shall be
    337 replaced by the text matched by the corresponding back-reference expression. If the corresponding back-reference expression does
    338 not match, then the characters <tt>"\</tt><i>n"</i> shall be replaced by the empty string. The special meaning of
    339 <tt>"\</tt><i>n"</i> where <i>n</i> is a digit in this context, can be suppressed by preceding it by a &lt;backslash&gt;. For each
    340 other &lt;backslash&gt; encountered, the following character shall lose its special meaning (if any).</p>
    341 <p>A line can be split by substituting a &lt;newline&gt; into it. The application shall escape the &lt;newline&gt; in the
    342 replacement by preceding it by a &lt;backslash&gt;.</p>
    343 <p>The meaning of an unescaped &lt;backslash&gt; immediately followed by any character other than <tt>'&amp;'</tt>,
    344 &lt;backslash&gt;, a digit, &lt;newline&gt;, or the delimiter character used for this command, is unspecified.</p>
    345 <p>Any &lt;backslash&gt; used to alter the default meaning of a subsequent character shall be discarded from the resulting
    346 replacement string. A substitution shall be considered to have been performed even if the resulting replacement string is identical
    347 to the string that it replaces.</p>
    348 <p>The value of <i>flags</i> shall be zero or more of:</p>
    349 <dl compact>
    350 <dd></dd>
    351 <dt><i>n</i></dt>
    352 <dd>Substitute for the <i>n</i>th occurrence only of the RE found within the pattern space.</dd>
    353 <dt><b>g</b></dt>
    354 <dd>Globally substitute for all non-overlapping instances of the RE rather than just the first one. If both <b>g</b> and <i>n</i>
    355 are specified, the results are unspecified.</dd>
    356 <dt><b>i</b></dt>
    357 <dd>Match the regular expression in a case-insensitive way.</dd>
    358 <dt><b>p</b></dt>
    359 <dd>Write the pattern space to standard output if a replacement was made.</dd>
    360 <dt><b>w&nbsp;</b><i>wfile</i></dt>
    361 <dd>Write. Append the pattern space to <i>wfile</i> if a replacement was made. A conforming application shall precede the
    362 <i>wfile</i> argument with one or more &lt;blank&gt; characters. If the <b>w</b> flag is not the last flag value given in a
    363 concatenation of multiple flag values, the results are undefined.</dd>
    364 </dl>
    365 </dd>
    366 <dt><b>[</b><i>2addr</i><b>]t&nbsp;[</b><i>label</i><b>]</b></dt>
    367 <dd><br>
    368 Test. Branch to the <b>:</b> command verb bearing the <i>label</i> if any substitutions have been made since the most recent
    369 reading of an input line or execution of a <b>t</b>. If <i>label</i> is not specified, branch to the end of the script.</dd>
    370 <dt><b>[</b><i>2addr</i><b>]w&nbsp;</b><i>wfile</i></dt>
    371 <dd><br>
    372 Append (write) the pattern space to <i>wfile</i>.</dd>
    373 <dt><b>[</b><i>2addr</i><b>]x</b></dt>
    374 <dd>Exchange the contents of the pattern and hold spaces.</dd>
    375 <dt><b>[</b><i>2addr</i><b>]y/</b><i>string1</i><b>/</b><i>string2</i><b>/</b></dt>
    376 <dd><br>
    377 Replace all occurrences of characters in <i>string1</i> with the corresponding characters in <i>string2</i>. If a &lt;backslash&gt;
    378 followed by an <tt>'n'</tt> appear in <i>string1</i> or <i>string2</i>, the two characters shall be handled as a single
    379 &lt;newline&gt;. If (after resolving any escape sequences) the numbers of characters in <i>string1</i> and <i>string2</i> are not
    380 equal, or if any of the characters in <i>string1</i> appear more than once, the results are undefined. Any character other than
    381 &lt;backslash&gt; or &lt;newline&gt; can be used instead of &lt;slash&gt; to delimit the strings. If the delimiter is not
    382 <tt>'n'</tt>, within <i>string1</i> and <i>string2</i>, the delimiter itself can be used as a literal character if it is preceded
    383 by an unescaped &lt;backslash&gt;. If a &lt;backslash&gt; character is escaped by an immediately preceding unescaped
    384 &lt;backslash&gt; character in <i>string1</i> or <i>string2</i>, the two &lt;backslash&gt; characters shall be treated as a single
    385 literal &lt;backslash&gt; character. The meaning of an unescaped &lt;backslash&gt; followed by any character that is not
    386 <tt>'n'</tt>, a &lt;backslash&gt;, or the delimiter character is undefined.</dd>
    387 <dt><b>[</b><i>0addr</i><b>]:</b><i>label</i></dt>
    388 <dd>Do nothing. This command bears a <i>label</i> to which the <b>b</b> and <b>t</b> commands branch.</dd>
    389 <dt><b>[</b><i>1addr</i><b>]=</b></dt>
    390 <dd>Write the following to standard output:
    391 <pre>
    392 <tt>"%d\n", &lt;</tt><i>current line number</i><tt>&gt;
    393 </tt></pre></dd>
    394 <dt><b>[</b><i>0addr</i><b>]</b></dt>
    395 <dd>Ignore this empty command.</dd>
    396 <dt><b>[</b><i>0addr</i><b>]#</b></dt>
    397 <dd>Ignore the <tt>'#'</tt> and the remainder of the line (treat them as a comment), with the single exception that if the first
    398 two characters in the script are <tt>"#n"</tt>, the default output shall be suppressed; this shall be the equivalent of specifying
    399 <b>-n</b> on the command line.</dd>
    400 </dl>
    401 </blockquote>
    402 <h4 class="mansect"><a name="tag_20_109_14" id="tag_20_109_14"></a>EXIT STATUS</h4>
    403 <blockquote>
    404 <p>The following exit values shall be returned:</p>
    405 <dl compact>
    406 <dd></dd>
    407 <dt>&nbsp;0</dt>
    408 <dd>Successful completion.</dd>
    409 <dt>&gt;0</dt>
    410 <dd>An error occurred.</dd>
    411 </dl>
    412 </blockquote>
    413 <h4 class="mansect"><a name="tag_20_109_15" id="tag_20_109_15"></a>CONSEQUENCES OF ERRORS</h4>
    414 <blockquote>
    415 <p>Default.</p>
    416 </blockquote>
    417 <hr>
    418 <div class="box"><em>The following sections are informative.</em></div>
    419 <h4 class="mansect"><a name="tag_20_109_16" id="tag_20_109_16"></a>APPLICATION USAGE</h4>
    420 <blockquote>
    421 <p>Regular expressions match entire strings, not just individual lines, but a &lt;newline&gt; is matched by <tt>'\n'</tt> in a
    422 <i>sed</i> RE; a &lt;newline&gt; is not allowed by the general definition of regular expression in POSIX.1-2024. Also note that
    423 <tt>'\n'</tt> cannot be used to match a &lt;newline&gt; at the end of an arbitrary input line; &lt;newline&gt; characters appear in
    424 the pattern space as a result of the <b>N</b> editing command.</p>
    425 <p>Applications that use a special RE character as a delimiter (for example, <tt>'.'</tt> or <tt>'*'</tt>) and need to use the
    426 delimiter as a literal character in the RE should put it inside a bracket expression, as implementations differ regarding whether
    427 escaping it with a &lt;backslash&gt; removes its special meaning. For example, for the context address <tt>"/\.[0-9]/"</tt> to be
    428 written with <tt>'.'</tt> as delimiter, the form <tt>"\.[.][0-9]."</tt> needs to be used; <tt>"\.\.[0-9]."</tt> cannot be used
    429 portably for this purpose, as it is unspecified whether this would be equivalent to <tt>"/\.[0-9]/"</tt> or <tt>"/.[0-9]/"</tt>.
    430 Portable applications cannot use a special RE character as a delimiter if that character needs to have its special meaning in the
    431 RE, as escaping it may remove its special meaning.</p>
    432 <p>When using <i>sed</i> to process pathnames, it is recommended that LC_ALL, or at least LC_CTYPE and LC_COLLATE, are set to POSIX
    433 or C in the environment, since pathnames can contain byte sequences that do not form valid characters in some locales, in which
    434 case the utility's behavior would be undefined. In the POSIX locale each byte is a valid single-byte character, and therefore this
    435 problem is avoided.</p>
    436 <p>Note that some implementations of <i>sed</i> also support an <b>I</b> flag for the <b>s</b> command as an alias for the lower
    437 case <b>i</b> flag.</p>
    438 <p>Some implementations of <i>sed</i>, when executed in a non-conforming environment, handle &lt;backslash&gt; escapes in regular
    439 expressions in a similar way to how <a href="../utilities/awk.html"><i>awk</i></a> handles them in the lexical token <b>ERE</b>
    440 (processing <tt>"\t"</tt> as a tab character, etc.). This is a compatible extension except that it conflicts with the requirements
    441 of this standard when &lt;backslash&gt; appears inside a bracket expression. A future version of this standard may allow this
    442 behavior, and therefore applications should use two &lt;backslash&gt; characters in bracket expressions instead of one in order to
    443 ensure future portability. On implementations conforming to the current standard, the second &lt;backslash&gt; is redundant. In the
    444 future (and in current non-conforming environments) the first &lt;backslash&gt; may escape the second.</p>
    445 </blockquote>
    446 <h4 class="mansect"><a name="tag_20_109_17" id="tag_20_109_17"></a>EXAMPLES</h4>
    447 <blockquote>
    448 <p>This <i>sed</i> script simulates the BSD <a href="../utilities/cat.html"><i>cat</i></a> <b>-s</b> command, squeezing excess
    449 empty lines from standard input.</p>
    450 <pre>
    451 <tt>sed -n '
    452 # Write non-empty lines.
    453 /./ {
    454     p
    455     d
    456     }
    457 # Write a single empty line, then look for more empty lines.
    458 /^$/    p
    459 # Get next line, discard the held &lt;newline&gt; (empty line),
    460 # and look for more empty lines.
    461 :Empty
    462 /^$/    {
    463     N
    464     s/.//
    465     b Empty
    466     }
    467 # Write the non-empty line before going back to search
    468 # for the first in a set of empty lines.
    469     p
    470 '
    471 </tt></pre>
    472 <p>The following <i>sed</i> command is a much simpler method of squeezing empty lines, although it is not quite the same as
    473 <a href="../utilities/cat.html"><i>cat</i></a> <b>-s</b> since it removes any initial empty lines:</p>
    474 <pre>
    475 <tt>sed -n '/./,/^$/p'
    476 </tt></pre></blockquote>
    477 <h4 class="mansect"><a name="tag_20_109_18" id="tag_20_109_18"></a>RATIONALE</h4>
    478 <blockquote>
    479 <p>This volume of POSIX.1-2024 requires implementations to support at least ten distinct <i>wfile</i>s, matching historical
    480 practice on many implementations. Implementations are encouraged to support more, but conforming applications should not exceed
    481 this limit.</p>
    482 <p>The exit status codes specified here are different from those in System V. System V returns 2 for garbled <i>sed</i> commands,
    483 but returns zero with its usage message or if the input file could not be opened. The standard developers considered this to be a
    484 bug.</p>
    485 <p>The manner in which the <b>l</b> command writes non-printable characters was changed to avoid the historical
    486 backspace-overstrike method, and other requirements to achieve unambiguous output were added. See the RATIONALE for <a href=
    487 "../utilities/ed.html#"><i>ed</i></a> for details of the format chosen, which is the same as that chosen for <i>sed</i>.</p>
    488 <p>This volume of POSIX.1-2024 requires implementations to provide pattern and hold spaces of at least 8192 bytes, larger than the
    489 4000 bytes spaces used by some historical implementations, but less than the 20480 bytes limit used in an early proposal.
    490 Implementations are encouraged to allocate dynamically larger pattern and hold spaces as needed.</p>
    491 <p>The requirements for acceptance of &lt;blank&gt; and &lt;space&gt; characters in command lines has been made more explicit than
    492 in early proposals to describe clearly the historical practice and to remove confusion about the phrase &quot;protect initial blanks
    493 [<i>sic</i>] and tabs from the stripping that is done on every script line&quot; that appears in much of the historical documentation
    494 of the <i>sed</i> utility description of text. (Not all implementations are known to have stripped &lt;blank&gt; characters from
    495 text lines, although they all have allowed leading &lt;blank&gt; characters preceding the address on a command line.)</p>
    496 <p>The treatment of <tt>'#'</tt> comments differs from the SVID which only allows a comment as the first line of the script, but
    497 matches BSD-derived implementations. The comment character is treated as a command, and it has the same properties in terms of
    498 being accepted with leading &lt;blank&gt; characters; the BSD implementation has historically supported this.</p>
    499 <p>Early proposals required that a <i>script_file</i> have at least one non-comment line. Some historical implementations have
    500 behaved in unexpected ways if this were not the case. The standard developers considered that this was incorrect behavior and that
    501 application developers should not have to avoid this feature. A correct implementation of this volume of POSIX.1-2024 shall permit
    502 <i>script_file</i>s that consist only of comment lines.</p>
    503 <p>Early proposals indicated that if <b>-e</b> and <b>-f</b> options were intermixed, all <b>-e</b> options were processed before
    504 any <b>-f</b> options. This has been changed to process them in the order presented because it matches historical practice and is
    505 more intuitive.</p>
    506 <p>The characters &lt;backslash&gt; and &lt;newline&gt; cannot be used as RE delimiter characters, as they can never be recognized
    507 as the ending delimiter:</p>
    508 <ul>
    509 <li>
    510 <p>&lt;backslash&gt; does not work, because if it appears unescaped later in the RE, it either escapes the following character,
    511 which can then never be the ending delimiter, or it is part of a bracket expression, inside which the ending delimiter for the RE
    512 cannot be located.</p>
    513 </li>
    514 <li>
    515 <p>&lt;newline&gt; does not work, because if not escaped, it terminates the command, meaning it cannot be the ending delimiter.</p>
    516 </li>
    517 </ul>
    518 <p>Some historical <i>sed</i> implementations did not support escaping <tt>'('</tt>, <tt>')'</tt>, <tt>'{'</tt>, and <tt>'}'</tt>
    519 when used as a BRE delimiter, as the sequences <tt>"\("</tt> and so on were still treated as special, usually resulting in an
    520 error. This standard requires that these sequences are treated as the literal character. This is for consistency with extensions.
    521 For example, some implementations treat <tt>"\s"</tt> in a BRE as matching white-space characters, as an extension. This cannot
    522 have its special meaning when <tt>'s'</tt> is used as a BRE delimiter in order to ensure portability of <i>sed</i> commands that
    523 have <tt>'s'</tt> as a delimiter and escape it. If <tt>"\s"</tt> were allowed to keep its special meaning, then the potential for
    524 further extensions would mean portable applications would not be able to escape any delimiter character other than
    525 &lt;slash&gt;.</p>
    526 <p>The treatment of the <b>p</b> flag to the <b>s</b> command differs between System V and BSD-based systems when the default
    527 output is suppressed. In the two examples:</p>
    528 <pre>
    529 <tt>echo a | sed    's/a/A/p'
    530 echo a | sed -n 's/a/A/p'
    531 </tt></pre>
    532 <p>this volume of POSIX.1-2024, BSD, System V documentation, and the SVID indicate that the first example should write two lines
    533 with <b>A</b>, whereas the second should write one. Some System V systems write the <b>A</b> only once in both examples because the
    534 <b>p</b> flag is ignored if the <b>-n</b> option is not specified.</p>
    535 <p>This is a case of a diametrical difference between systems that could not be reconciled through the compromise of declaring the
    536 behavior to be unspecified. The SVID/BSD/System V documentation behavior was adopted for this volume of POSIX.1-2024 because:</p>
    537 <ul>
    538 <li>
    539 <p>No known documentation for any historic system describes the interaction between the <b>p</b> flag and the <b>-n</b> option.</p>
    540 </li>
    541 <li>
    542 <p>The selected behavior is more correct as there is no technical justification for any interaction between the <b>p</b> flag and
    543 the <b>-n</b> option. A relationship between <b>-n</b> and the <b>p</b> flag might imply that they are only used together, but this
    544 ignores valid scripts that interrupt the cyclical nature of the processing through the use of the <b>D</b>, <b>d</b>, <b>q</b>, or
    545 branching commands. Such scripts rely on the <b>p</b> suffix to write the pattern space because they do not make use of the default
    546 output at the &quot;bottom&quot; of the script.</p>
    547 </li>
    548 <li>
    549 <p>Because the <b>-n</b> option makes the <b>p</b> flag unnecessary, any interaction would only be useful if <i>sed</i> scripts
    550 were written to run both with and without the <b>-n</b> option. This is believed to be unlikely. It is even more unlikely that
    551 programmers have coded the <b>p</b> flag expecting it to be unnecessary. Because the interaction was not documented, the likelihood
    552 of a programmer discovering the interaction and depending on it is further decreased.</p>
    553 </li>
    554 <li>
    555 <p>Finally, scripts that break under the specified behavior produce too much output instead of too little, which is easier to
    556 diagnose and correct.</p>
    557 </li>
    558 </ul>
    559 <p>The form of the substitute command that uses the <b>n</b> suffix was limited to the first 512 matches in an early proposal. This
    560 limit has been removed because there is no reason an editor processing lines of {LINE_MAX} length should have this restriction. The
    561 command <b>s/a/A/2047</b> should be able to substitute the 2047th occurrence of <b>a</b> on a line.</p>
    562 <p>The <b>b</b>, <b>t</b>, and <b>:</b> commands are documented to ignore leading white space, but no mention is made of trailing
    563 white space. Historical implementations of <i>sed</i> assigned different locations to the labels <tt>'x'</tt> and
    564 <tt>"x&nbsp;"</tt>. This is not useful, and leads to subtle programming errors, but it is historical practice, and changing it
    565 could theoretically break working scripts. Implementors are encouraged to provide warning messages about labels that are never
    566 referenced by a <b>b</b> or <b>t</b> command, jumps to labels that do not exist, and label arguments that are subject to
    567 truncation.</p>
    568 <p>Earlier versions of this standard allowed for implementations with bytes other than eight bits, but this has been modified in
    569 this version.</p>
    570 </blockquote>
    571 <h4 class="mansect"><a name="tag_20_109_19" id="tag_20_109_19"></a>FUTURE DIRECTIONS</h4>
    572 <blockquote>
    573 <p>A future version of this standard may allow <i>sed</i> to handle &lt;backslash&gt; escapes in regular expressions in a similar
    574 way to how <a href="../utilities/awk.html"><i>awk</i></a> handles them in the lexical token <b>ERE</b>. (&quot;Similar&quot; rather than
    575 &quot;the same&quot; because <i>sed</i> can use BREs or EREs whereas <a href="../utilities/awk.html"><i>awk</i></a> uses only EREs.)</p>
    576 </blockquote>
    577 <h4 class="mansect"><a name="tag_20_109_20" id="tag_20_109_20"></a>SEE ALSO</h4>
    578 <blockquote>
    579 <p><a href="../utilities/awk.html#"><i>awk</i></a> , <a href="../utilities/ed.html#"><i>ed</i></a> , <a href=
    580 "../utilities/grep.html#"><i>grep</i></a></p>
    581 <p>XBD <a href="../basedefs/V1_chap05.html#tagtcjh_2"><i>Escape Sequences and Associated Actions</i></a> , <a href=
    582 "../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href="../basedefs/V1_chap09.html#tag_09_03"><i>9.3
    583 Basic Regular Expressions</i></a> , <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    584 </blockquote>
    585 <h4 class="mansect"><a name="tag_20_109_21" id="tag_20_109_21"></a>CHANGE HISTORY</h4>
    586 <blockquote>
    587 <p>First released in Issue 2.</p>
    588 </blockquote>
    589 <h4 class="mansect"><a name="tag_20_109_22" id="tag_20_109_22"></a>Issue 5</h4>
    590 <blockquote>
    591 <p>The FUTURE DIRECTIONS section is added.</p>
    592 </blockquote>
    593 <h4 class="mansect"><a name="tag_20_109_23" id="tag_20_109_23"></a>Issue 6</h4>
    594 <blockquote>
    595 <p>The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:</p>
    596 <ul>
    597 <li>
    598 <p>Implementations are required to support at least ten <i>wfile</i> arguments in an editing command.</p>
    599 </li>
    600 </ul>
    601 <p>The EXTENDED DESCRIPTION is changed to align with the IEEE&nbsp;P1003.2b draft standard.</p>
    602 <p>IEEE PASC Interpretation 1003.2 #190 is applied.</p>
    603 <p>IEEE PASC Interpretation 1003.2 #203 is applied, clarifying the meaning of the &lt;backslash&gt;-escape sequences in a
    604 replacement string for a BRE.</p>
    605 <p>IEEE&nbsp;Std&nbsp;1003.1-2001/Cor&nbsp;2-2004, item XCU/TC2/D6/28 is applied, removing text describing behavior on systems with
    606 bytes consisting of more than eight bits.</p>
    607 <p>IEEE&nbsp;Std&nbsp;1003.1-2001/Cor&nbsp;2-2004, item XCU/TC2/D6/29 is applied, making an editorial correction within the Editing
    608 Commands in <i>sed</i> section.</p>
    609 </blockquote>
    610 <h4 class="mansect"><a name="tag_20_109_24" id="tag_20_109_24"></a>Issue 7</h4>
    611 <blockquote>
    612 <p>Austin Group Interpretations 1003.1-2001 #006, #036, and #092 are applied.</p>
    613 <p>SD5-XCU-ERN-97 and SD5-XCU-ERN-123 are applied, updating the SYNOPSIS.</p>
    614 <p>A second example is added.</p>
    615 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0133 [262], XCU/TC1-2008/0134 [282,431], XCU/TC1-2008/0135 [269], and
    616 XCU/TC1-2008/0136 [282,431] are applied.</p>
    617 <p>POSIX.1-2008, Technical Corrigendum 2, XCU/TC2-2008/0166 [945], XCU/TC2-2008/0167 [944], XCU/TC2-2008/0168 [945],
    618 XCU/TC2-2008/0169 [944], XCU/TC2-2008/0170 [945], XCU/TC2-2008/0171 [533], XCU/TC2-2008/0172 [663], XCU/TC2-2008/0173 [945], and
    619 XCU/TC2-2008/0174 [944] are applied.</p>
    620 </blockquote>
    621 <h4 class="mansect"><a name="tag_20_109_25" id="tag_20_109_25"></a>Issue 8</h4>
    622 <blockquote>
    623 <p>Austin Group Defect 528 is applied, adding support for selecting the use of EREs instead of BREs, by specifying the <b>-E</b>
    624 option.</p>
    625 <p>Austin Group Defect 779 is applied, adding the <b>i</b> flag to the <b>s</b> command.</p>
    626 <p>Austin Group Defect 961 is applied, requiring that <b>{...}</b> can be followed by a &lt;semicolon&gt;, optional &lt;blank&gt;
    627 characters, and another editing command.</p>
    628 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    629 <p>Austin Group Defect 1231 is applied, clarifying the handling of &lt;backslash&gt; in <i>text</i> arguments.</p>
    630 <p>Austin Group Defect 1233 is applied, changing the APPLICATION USAGE and FUTURE DIRECTIONS sections.</p>
    631 <p>Austin Group Defect 1319 is applied, changing when the text specified for the <b>a</b> command and the contents of the file
    632 specified for the <b>r</b> command are written.</p>
    633 <p>Austin Group Defect 1550 is applied, clarifying requirements relating to delimiters in context addresses and in <b>s</b> and
    634 <b>y</b> commands.</p>
    635 <p>Austin Group Defect 1578 is applied, clarifying the description of the <b>y</b> command.</p>
    636 <p>Austin Group Defect 1767 is applied, clarifying that a <b>c</b> command starts the next cycle on every line that its address
    637 range matches.</p>
    638 </blockquote>
    639 <div class="box"><em>End of informative text.</em></div>
    640 <hr>
    641 <p>&nbsp;</p>
    642 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    643 <hr size="2" noshade>
    644 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    645 POSIX™ is a Trademark of The IEEE.<br>
    646 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    647 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    648 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    649 ]</font></center>
    650 <hr size="2" noshade>
    651 <div class="NAVHEADER">
    652 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    653 <tr class="nav">
    654 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/sccs.html" accesskey="P">&lt;&lt;&lt;
    655 Previous</a></td>
    656 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    657 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/sh.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    658 </tr>
    659 </table>
    660 <hr align="left" width="100%"></div>
    661 </body>
    662 </html>