[BACK]Return to sed.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / sed

Annotation of src/usr.bin/sed/sed.1, Revision 1.60

1.60    ! jsg         1: .\"    $OpenBSD: sed.1,v 1.59 2020/10/16 09:29:04 jmc Exp $
1.12      aaron       2: .\"
1.1       deraadt     3: .\" Copyright (c) 1992, 1993
                      4: .\"    The Regents of the University of California.  All rights reserved.
                      5: .\"
                      6: .\" This code is derived from software contributed to Berkeley by
                      7: .\" the Institute of Electrical and Electronics Engineers, Inc.
                      8: .\"
                      9: .\" Redistribution and use in source and binary forms, with or without
                     10: .\" modification, are permitted provided that the following conditions
                     11: .\" are met:
                     12: .\" 1. Redistributions of source code must retain the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer.
                     14: .\" 2. Redistributions in binary form must reproduce the above copyright
                     15: .\"    notice, this list of conditions and the following disclaimer in the
                     16: .\"    documentation and/or other materials provided with the distribution.
1.17      millert    17: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    18: .\"    may be used to endorse or promote products derived from this software
                     19: .\"    without specific prior written permission.
                     20: .\"
                     21: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     22: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     23: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     24: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     25: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     26: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     27: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     28: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     29: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     30: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     31: .\" SUCH DAMAGE.
                     32: .\"
                     33: .\"    from: @(#)sed.1 8.2 (Berkeley) 12/30/93
                     34: .\"
1.60    ! jsg        35: .Dd $Mdocdate: October 16 2020 $
1.1       deraadt    36: .Dt SED 1
                     37: .Os
                     38: .Sh NAME
                     39: .Nm sed
                     40: .Nd stream editor
                     41: .Sh SYNOPSIS
                     42: .Nm sed
1.34      jmc        43: .Op Fl aEnru
1.46      jmc        44: .Op Fl i Ns Op Ar extension
1.1       deraadt    45: .Ar command
1.29      sobrado    46: .Op Ar
1.1       deraadt    47: .Nm sed
1.33      djm        48: .Op Fl aEnru
1.1       deraadt    49: .Op Fl e Ar command
                     50: .Op Fl f Ar command_file
1.45      jasper     51: .Op Fl i Ns Op Ar extension
1.29      sobrado    52: .Op Ar
1.1       deraadt    53: .Sh DESCRIPTION
                     54: The
1.8       aaron      55: .Nm
1.1       deraadt    56: utility reads the specified files, or the standard input if no files
                     57: are specified, modifying the input as specified by a list of commands.
                     58: The input is then written to the standard output.
                     59: .Pp
                     60: A single command may be specified as the first argument to
                     61: .Nm sed .
1.25      jmc        62: Multiple commands may be specified
                     63: separated by newlines or semicolons,
                     64: or by using the
1.1       deraadt    65: .Fl e
                     66: or
                     67: .Fl f
                     68: options.
                     69: All commands are applied to the input in the order they are specified
                     70: regardless of their origin.
                     71: .Pp
1.10      aaron      72: The options are as follows:
1.16      aaron      73: .Bl -tag -width Ds
1.1       deraadt    74: .It Fl a
                     75: The files listed as parameters for the
1.41      jmc        76: .Ic w
                     77: function or flag are created (or truncated) before any processing begins,
1.1       deraadt    78: by default.
                     79: The
                     80: .Fl a
                     81: option causes
1.8       aaron      82: .Nm
1.1       deraadt    83: to delay opening each file until a command containing the related
1.41      jmc        84: .Ic w
                     85: function or flag is applied to a line of input.
1.34      jmc        86: .It Fl E
                     87: Interpret regular expressions using POSIX extended regular expression syntax.
                     88: The default behaviour is to use POSIX basic regular expression syntax.
1.1       deraadt    89: .It Fl e Ar command
                     90: Append the editing commands specified by the
                     91: .Ar command
                     92: argument
                     93: to the list of commands.
                     94: .It Fl f Ar command_file
                     95: Append the editing commands found in the file
                     96: .Ar command_file
                     97: to the list of commands.
                     98: The editing commands should each be listed on a separate line.
1.46      jmc        99: .It Fl i Ns Op Ar extension
                    100: Edit files in place, saving backups with the specified
1.45      jasper    101: .Ar extension .
1.46      jmc       102: If a zero length
1.45      jasper    103: .Ar extension
                    104: is given, no backup will be saved.
1.46      jmc       105: It is not recommended to give a zero length
1.45      jasper    106: .Ar extension
1.46      jmc       107: when in place editing files, as it risks corruption or partial content
1.45      jasper    108: in situations where disk space is exhausted, etc.
1.57      martijn   109: In
                    110: .Fl i
                    111: mode, the hold space, line numbers, and ranges are reset between files.
1.33      djm       112: .It Fl r
1.34      jmc       113: An alias for
                    114: .Fl E ,
                    115: for compatibility with GNU sed.
1.1       deraadt   116: .It Fl n
                    117: By default, each line of input is echoed to the standard output after
                    118: all of the commands have been applied to it.
                    119: The
                    120: .Fl n
                    121: option suppresses this behavior.
1.26      ray       122: .It Fl u
                    123: Force output to be line buffered,
                    124: printing each line as it becomes available.
                    125: By default, output is line buffered when standard output is a terminal
                    126: and block buffered otherwise.
                    127: See
1.47      tedu      128: .Xr setvbuf 3
1.26      ray       129: for a more detailed explanation.
1.1       deraadt   130: .El
                    131: .Pp
                    132: The form of a
1.8       aaron     133: .Nm
1.1       deraadt   134: command is as follows:
1.21      jmc       135: .Pp
1.1       deraadt   136: .Dl [address[,address]]function[arguments]
1.21      jmc       137: .Pp
1.1       deraadt   138: Whitespace may be inserted before the first address and the function
                    139: portions of the command.
                    140: .Pp
                    141: Normally,
1.8       aaron     142: .Nm
1.1       deraadt   143: cyclically copies a line of input, not including its terminating newline
                    144: character, into a
1.21      jmc       145: .Em pattern space ,
1.1       deraadt   146: (unless there is something left after a
1.37      jmc       147: .Ic D
1.1       deraadt   148: function),
                    149: applies all of the commands with addresses that select that pattern space,
                    150: copies the pattern space to the standard output, appending a newline, and
                    151: deletes the pattern space.
                    152: .Pp
                    153: Some of the functions use a
1.21      jmc       154: .Em hold space
1.1       deraadt   155: to save all or part of the pattern space for subsequent retrieval.
1.21      jmc       156: .Sh SED ADDRESSES
1.1       deraadt   157: An address is not required, but if specified must be a number (that counts
                    158: input lines
1.21      jmc       159: cumulatively across input files), a dollar character
1.8       aaron     160: .Pq Ql $
1.55      schwarze  161: that addresses the last line of input, or a context address,
                    162: which is a regular expression preceded and followed by a delimiter.
1.56      martijn   163: The delimiter can be any character except a newline or a backslash.
1.55      schwarze  164: Unless it is a slash, the opening delimiter needs to be escaped with
                    165: a backslash.
1.1       deraadt   166: .Pp
                    167: A command line with no addresses selects every pattern space.
                    168: .Pp
                    169: A command line with one address selects all of the pattern spaces
                    170: that match the address.
                    171: .Pp
                    172: A command line with two addresses selects the inclusive range from
                    173: the first pattern space that matches the first address through the next
                    174: pattern space that matches the second.
                    175: (If the second address is a number less than or equal to the line number
                    176: first selected, only that line is selected.)
                    177: Starting at the first line following the selected range,
1.8       aaron     178: .Nm
1.1       deraadt   179: starts looking again for the first address.
                    180: .Pp
                    181: Editing commands can be applied to non-selected pattern spaces by use
                    182: of the exclamation character
1.18      jmc       183: .Pq Ql \&!
1.1       deraadt   184: function.
1.21      jmc       185: .Sh SED REGULAR EXPRESSIONS
1.34      jmc       186: By default,
1.8       aaron     187: .Nm
1.23      jmc       188: regular expressions are basic regular expressions
                    189: .Pq BREs .
1.34      jmc       190: Extended regular expressions are supported using the
                    191: .Fl E
                    192: and
                    193: .Fl r
                    194: options.
1.23      jmc       195: See
1.19      jmc       196: .Xr re_format 7
1.23      jmc       197: for more information on regular expressions.
1.1       deraadt   198: In addition,
1.8       aaron     199: .Nm
1.23      jmc       200: has the following two additions to BREs:
1.21      jmc       201: .Pp
1.1       deraadt   202: .Bl -enum -compact
                    203: .It
1.55      schwarze  204: The character delimiting the regular expression
                    205: can be used inside the regular expression by prepending a backslash
                    206: or by including it in a character class.
                    207: For example, in the context address \ex\ex[xy]x, the RE delimiter
1.1       deraadt   208: is an
1.8       aaron     209: .Sq x
1.55      schwarze  210: and the other
1.8       aaron     211: .Sq x
1.55      schwarze  212: characters stand for themselves, so that the regular expression is
                    213: .Dq x[xy] .
1.21      jmc       214: .Pp
1.1       deraadt   215: .It
                    216: The escape sequence \en matches a newline character embedded in the
                    217: pattern space.
                    218: You can't, however, use a literal newline character in an address or
                    219: in the substitute command.
                    220: .El
                    221: .Pp
                    222: One special feature of
1.8       aaron     223: .Nm
1.1       deraadt   224: regular expressions is that they can default to the last regular
                    225: expression used.
1.13      aaron     226: If a regular expression is empty, i.e., just the delimiter characters
1.1       deraadt   227: are specified, the last regular expression encountered is used instead.
                    228: The last regular expression is defined as the last regular expression
                    229: used as part of an address or substitute command, and at run-time, not
                    230: compile-time.
                    231: For example, the command
                    232: .Dq /abc/s//XXX/
                    233: will substitute
                    234: .Dq XXX
                    235: for the pattern
                    236: .Dq abc .
1.21      jmc       237: .Sh SED FUNCTIONS
1.1       deraadt   238: In the following list of commands, the maximum number of permissible
                    239: addresses for each command is indicated by [0addr], [1addr], or [2addr],
                    240: representing zero, one, or two addresses.
                    241: .Pp
                    242: The argument
1.37      jmc       243: .Ar text
1.1       deraadt   244: consists of one or more lines.
                    245: To embed a newline in the text, precede it with a backslash.
                    246: Other backslashes in text are deleted and the following character
                    247: taken literally.
                    248: .Pp
                    249: The
1.40      jmc       250: .Ic r
1.1       deraadt   251: and
1.40      jmc       252: .Ic w
                    253: functions,
                    254: as well as the
                    255: .Cm w
                    256: flag to the
                    257: .Ic s
                    258: function,
1.52      martijn   259: take a
1.40      jmc       260: .Ar file
                    261: parameter,
                    262: which should be separated from the function or flag by whitespace.
                    263: Files are created
                    264: (or their contents truncated)
                    265: before any input processing begins.
1.1       deraadt   266: .Pp
                    267: The
1.40      jmc       268: .Ic b ,
                    269: .Ic r ,
                    270: .Ic s ,
                    271: .Ic t ,
                    272: .Ic w ,
                    273: .Ic y ,
1.1       deraadt   274: and
1.40      jmc       275: .Ic \&:
1.1       deraadt   276: functions all accept additional arguments.
1.40      jmc       277: The synopses below indicate which arguments have to be separated from
1.9       aaron     278: the function letters by whitespace characters.
1.1       deraadt   279: .Pp
1.58      schwarze  280: The
                    281: .Ic a ,
                    282: .Ic c ,
                    283: .Ic i ,
                    284: .Ic r ,
                    285: and
                    286: .Ic w
                    287: functions cannot be followed by another command separated with a semicolon.
                    288: The
                    289: .Ar text
                    290: and
                    291: .Ar file
                    292: arguments may contain semicolon characters.
                    293: .Pp
1.41      jmc       294: Functions can be combined to form a
                    295: .Em function list ,
                    296: a list of
1.8       aaron     297: .Nm
1.44      schwarze  298: functions each followed by a newline, as follows:
1.1       deraadt   299: .Bd -literal -offset indent
                    300: { function
                    301:   function
                    302:   ...
                    303:   function
                    304: }
                    305: .Ed
                    306: .Pp
1.44      schwarze  307: The braces can be preceded and followed by whitespace.
                    308: The functions can be preceded by whitespace as well.
1.38      jmc       309: .Pp
1.40      jmc       310: Functions and function lists may be preceded by an exclamation mark,
1.38      jmc       311: in which case they are applied only to lines that are
                    312: .Em not
                    313: selected by the addresses.
1.37      jmc       314: .Bl -tag -width Ds
1.51      martijn   315: .It [2addr] Ns Ar function-list
1.15      aaron     316: Execute
1.37      jmc       317: .Ar function-list
1.15      aaron     318: only when the pattern space is selected.
1.51      martijn   319: .It Xo [1addr] Ns Ic a Ns \e
1.37      jmc       320: .br
                    321: .Ar text
                    322: .Xc
1.1       deraadt   323: Write
1.37      jmc       324: .Ar text
1.1       deraadt   325: to standard output immediately before each attempt to read a line of input,
                    326: whether by executing the
1.37      jmc       327: .Ic N
1.1       deraadt   328: function or by beginning a new cycle.
1.37      jmc       329: .It [2addr] Ns Ic b Bq Ar label
1.1       deraadt   330: Branch to the
1.37      jmc       331: .Ic \&:
                    332: function with the specified
                    333: .Ar label .
1.1       deraadt   334: If the label is not specified, branch to the end of the script.
1.51      martijn   335: .It Xo [2addr] Ns Ic c Ns \e
1.37      jmc       336: .br
                    337: .Ar text
                    338: .Xc
1.1       deraadt   339: Delete the pattern space.
                    340: With 0 or 1 address or at the end of a 2-address range,
1.37      jmc       341: .Ar text
1.1       deraadt   342: is written to the standard output.
1.37      jmc       343: .It [2addr] Ns Ic d
1.1       deraadt   344: Delete the pattern space and start the next cycle.
1.37      jmc       345: .It [2addr] Ns Ic D
1.1       deraadt   346: Delete the initial segment of the pattern space through the first
                    347: newline character and start the next cycle.
1.37      jmc       348: .It [2addr] Ns Ic g
1.1       deraadt   349: Replace the contents of the pattern space with the contents of the
                    350: hold space.
1.37      jmc       351: .It [2addr] Ns Ic G
1.1       deraadt   352: Append a newline character followed by the contents of the hold space
                    353: to the pattern space.
1.37      jmc       354: .It [2addr] Ns Ic h
1.1       deraadt   355: Replace the contents of the hold space with the contents of the
                    356: pattern space.
1.37      jmc       357: .It [2addr] Ns Ic H
1.1       deraadt   358: Append a newline character followed by the contents of the pattern space
                    359: to the hold space.
1.51      martijn   360: .It Xo [1addr] Ns Ic i Ns \e
1.37      jmc       361: .br
                    362: .Ar text
                    363: .Xc
1.1       deraadt   364: Write
1.37      jmc       365: .Ar text
1.1       deraadt   366: to the standard output.
1.37      jmc       367: .It [2addr] Ns Ic l
1.1       deraadt   368: (The letter ell.)
                    369: Write the pattern space to the standard output in a visually unambiguous
                    370: form.
                    371: This form is as follows:
1.21      jmc       372: .Pp
1.1       deraadt   373: .Bl -tag -width "carriage-returnXX" -offset indent -compact
                    374: .It backslash
1.3       deraadt   375: \e\e
1.1       deraadt   376: .It alert
                    377: \ea
1.31      millert   378: .It backspace
                    379: \eb
1.1       deraadt   380: .It form-feed
                    381: \ef
                    382: .It carriage-return
                    383: \er
                    384: .It tab
                    385: \et
                    386: .It vertical tab
                    387: \ev
                    388: .El
                    389: .Pp
1.15      aaron     390: Non-printable characters are written as three-digit octal numbers (with a
1.1       deraadt   391: preceding backslash) for each byte in the character (most significant byte
                    392: first).
                    393: Long lines are folded, with the point of folding indicated by displaying
                    394: a backslash followed by a newline.
                    395: The end of each line is marked with a
1.8       aaron     396: .Ql $ .
1.37      jmc       397: .It [2addr] Ns Ic n
1.1       deraadt   398: Write the pattern space to the standard output if the default output has
                    399: not been suppressed, and replace the pattern space with the next line of
                    400: input.
1.37      jmc       401: .It [2addr] Ns Ic N
1.1       deraadt   402: Append the next line of input to the pattern space, using an embedded
                    403: newline character to separate the appended material from the original
                    404: contents.
                    405: Note that the current line number changes.
1.37      jmc       406: .It [2addr] Ns Ic p
1.1       deraadt   407: Write the pattern space to standard output.
1.37      jmc       408: .It [2addr] Ns Ic P
1.39      jmc       409: Write the pattern space, up to the first newline character,
                    410: to the standard output.
1.37      jmc       411: .It [1addr] Ns Ic q
1.57      martijn   412: Branch to the end of the script and quit without starting a new cycle or file.
1.37      jmc       413: .It [1addr] Ns Ic r Ar file
1.1       deraadt   414: Copy the contents of
1.37      jmc       415: .Ar file
1.1       deraadt   416: to the standard output immediately before the next attempt to read a
                    417: line of input.
                    418: If
1.37      jmc       419: .Ar file
1.1       deraadt   420: cannot be read for any reason, it is silently ignored and no error
                    421: condition is set.
1.37      jmc       422: .It [2addr] Ns Ic s Ns / Ns Ar RE Ns / Ns Ar replacement Ns / Ns Ar flags
                    423: Substitute the
                    424: .Ar replacement
                    425: string for the first instance of the regular expression
                    426: .Ar RE
                    427: in the pattern space.
1.1       deraadt   428: Any character other than backslash or newline can be used instead of
1.37      jmc       429: a slash to delimit the regular expression and the replacement.
1.59      jmc       430: Also see the section about
1.55      schwarze  431: .Sx SED REGULAR EXPRESSIONS .
1.1       deraadt   432: .Pp
                    433: An ampersand
1.8       aaron     434: .Pq Ql &
1.37      jmc       435: appearing in the replacement is replaced by the string matching the
                    436: regular expression.
1.1       deraadt   437: The string
1.8       aaron     438: .Ql \e# ,
1.1       deraadt   439: where
1.8       aaron     440: .Ql #
1.1       deraadt   441: is a digit, is replaced by the text matched
                    442: by the corresponding backreference expression (see
1.14      aaron     443: .Xr re_format 7 ) .
1.1       deraadt   444: .Pp
1.56      martijn   445: All other instances of a backslash will print the literal character
                    446: following it.
                    447: Using a backslash before any other character other than
                    448: .Ql & ,
                    449: .Ql \e ,
                    450: digit, newline
                    451: .Pq ascii 0x0a ,
                    452: and the delimiter is unspecified and might not be portable to other
                    453: implementations of
                    454: .Nm .
1.1       deraadt   455: .Pp
                    456: The value of
1.37      jmc       457: .Ar flags
1.1       deraadt   458: in the substitute function is zero or more of the following:
                    459: .Bl -tag -width "XXXXXX" -offset indent
1.49      schwarze  460: .It Ar N
                    461: Make the substitution only for the
                    462: .Ar N Ap th
                    463: occurrence of the regular expression in the pattern space, where
                    464: .Ar N
                    465: is a positive integer starting with
                    466: .Cm 1 No ... Cm 9 .
1.37      jmc       467: .It Cm g
1.1       deraadt   468: Make the substitution for all non-overlapping matches of the
                    469: regular expression, not just the first one.
1.37      jmc       470: .It Cm p
1.1       deraadt   471: Write the pattern space to standard output if a replacement was made.
                    472: If the replacement string is identical to that which it replaces, it
                    473: is still considered to have been a replacement.
1.37      jmc       474: .It Cm w Ar file
1.1       deraadt   475: Append the pattern space to
1.37      jmc       476: .Ar file
1.1       deraadt   477: if a replacement was made.
                    478: If the replacement string is identical to that which it replaces, it
                    479: is still considered to have been a replacement.
                    480: .El
1.37      jmc       481: .It [2addr] Ns Ic t Bq Ar label
1.1       deraadt   482: Branch to the
1.37      jmc       483: .Ic \&:
                    484: function bearing the
                    485: .Ar label
                    486: if any substitutions have been made since the
1.1       deraadt   487: most recent reading of an input line or execution of a
1.37      jmc       488: .Ic t
1.1       deraadt   489: function.
                    490: If no label is specified, branch to the end of the script.
1.37      jmc       491: .It [2addr] Ns Ic w Ar file
1.1       deraadt   492: Append the pattern space to the
1.37      jmc       493: .Ar file .
                    494: .It [2addr] Ns Ic x
1.1       deraadt   495: Swap the contents of the pattern and hold spaces.
1.37      jmc       496: .It [2addr] Ns Ic y Ns / Ns Ar string1 Ns / Ns Ar string2 Ns /
1.1       deraadt   497: Replace all occurrences of characters in
1.37      jmc       498: .Ar string1
1.1       deraadt   499: in the pattern space with the corresponding characters from
1.37      jmc       500: .Ar string2 .
1.1       deraadt   501: Any character other than a backslash or newline can be used instead of
                    502: a slash to delimit the strings.
1.53      martijn   503: .Pp
1.1       deraadt   504: Within
1.37      jmc       505: .Ar string1
1.1       deraadt   506: and
1.37      jmc       507: .Ar string2 ,
1.53      martijn   508: a backslash followed by another backslash
                    509: is replaced by a single backslash,
                    510: a backslash followed by an
                    511: .Sq n
                    512: is replaced by a newline character,
                    513: and a backslash followed by the delimiting character
                    514: is replaced by that character,
                    515: causing it to be treated literally,
                    516: with the exception of the
1.8       aaron     517: .Sq n
1.53      martijn   518: character,
                    519: which will still be treated like a newline character.
                    520: It is an error for a backslash to not be followed by another backslash,
                    521: .Sq n ,
                    522: or the delimiting character,
                    523: or for
                    524: .Ar string1
                    525: to contain repeating characters.
1.37      jmc       526: .It [0addr] Ns Ic \&: Ns Ar label
                    527: This function does nothing; it bears a
                    528: .Ar label
                    529: to which the
                    530: .Ic b
1.1       deraadt   531: and
1.37      jmc       532: .Ic t
1.1       deraadt   533: commands may branch.
1.37      jmc       534: .It [1addr] Ns Ic =
1.15      aaron     535: Write the line number to the standard output followed by a newline character.
1.1       deraadt   536: .It [0addr]
                    537: Empty lines are ignored.
1.37      jmc       538: .It [0addr] Ns Ic #
1.1       deraadt   539: The
1.8       aaron     540: .Ql #
1.1       deraadt   541: and the remainder of the line are ignored (treated as a comment), with
                    542: the single exception that if the first two characters in the file are
1.8       aaron     543: .Ql #n ,
1.1       deraadt   544: the default output is suppressed.
                    545: This is the same as specifying the
                    546: .Fl n
                    547: option on the command line.
1.48      bentley   548: .El
                    549: .Sh ENVIRONMENT
                    550: .Bl -tag -width COLUMNS
                    551: .It Ev COLUMNS
                    552: If set to a positive integer,
                    553: output from the
                    554: .Ic l
                    555: function is formatted to the given width in columns.
                    556: Otherwise,
                    557: .Nm
1.51      martijn   558: defaults to the terminal width, or 80 columns if the output is not a terminal.
1.1       deraadt   559: .El
1.36      jmc       560: .Sh EXIT STATUS
1.24      jmc       561: .Ex -std sed
1.1       deraadt   562: .Sh SEE ALSO
                    563: .Xr awk 1 ,
                    564: .Xr ed 1 ,
                    565: .Xr grep 1 ,
                    566: .Xr re_format 7
1.60    ! jsg       567: .Rs
        !           568: .\" 4.4BSD USD:15
        !           569: .%A Lee E. McMahon
        !           570: .%I AT&T Bell Laboratories
        !           571: .%T SED \(em A Non-interactive Text Editor
        !           572: .%R Computing Science Technical Report
        !           573: .%N 77
        !           574: .%D January 1979
        !           575: .Re
1.1       deraadt   576: .Sh STANDARDS
                    577: The
1.8       aaron     578: .Nm
1.25      jmc       579: utility is compliant with the
1.32      jmc       580: .St -p1003.1-2008
1.1       deraadt   581: specification.
1.25      jmc       582: .Pp
1.26      ray       583: The flags
1.45      jasper    584: .Op Fl aEiru
1.27      jmc       585: are extensions to that specification.
1.25      jmc       586: .Pp
1.58      schwarze  587: Following the
                    588: .Ic b ,
                    589: .Ic t ,
                    590: or
                    591: .Ic \&:
                    592: commands with a semicolon and another command is an extension to the
                    593: specification.
                    594: .Pp
1.25      jmc       595: The use of newlines to separate multiple commands on the command line
                    596: is non-portable;
                    597: the use of newlines to separate multiple commands within a command file
                    598: .Pq Fl f Ar command_file
                    599: is portable.
1.11      aaron     600: .Sh HISTORY
                    601: A
                    602: .Nm
                    603: command appeared in
                    604: .At v7 .