| www.delorie.com/gnu/docs/sed/sed_2.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
sed may be invoked with the following command-line options:
-V
--version
sed that is being run and a copyright notice,
then exit.
-h
--help
-n
--quiet
--silent
sed prints out the pattern space
at the end of each cycle through the script.
These options disable this automatic printing,
and sed only produces output when explicitly told to
via the p command.
-i[SUFFIX]
--in-place[=SUFFIX]
sed does this by creating a temporary file and
sending output to this file rather than to the standard
output.(1)
When the end of the file is reached, the temporary file is renamed to the output file's original name.
The extension, if supplied, is used to modify the name of
the old file before renaming the temporary file (thereby
making a backup copy(2)) following
this rule: if the extension doesn't contain a *,
then it is appended to the end of the current filename
as a suffix; if the extension does contain one or more
* characters, then each asterisk is
replaced with the current filename. This allows
you to add a prefix to the backup file, instead of (or in
addition to) a suffix, or even to place backup copies of
the original files into another directory (provided the
directory already exists).
This option implies `-s'.
-l N
--line-length=N
l command.
A length of 0 (zero) means to never wrap long lines. If
not specified, it is taken to be 70.
-r
--regexp-extended
egrep accepts; they can be clearer because they
usually have less backslashes, but are a GNU extension
and hence scripts that use them are not portable.
See section Extended regular expressions.
-s
--separate
sed will consider the files specified on the
command line as a single continuous long stream. This GNU sed
extension allows the user to consider them as separate files:
range addresses (such as `/abc/,/def/') are not allowed
to span several files, line numbers are relative to the start
of each file, $ refers to the last line of each file,
and files invoked from the R commands are rewound at the
start of each file.
-u
--unbuffered
-e script
--expression=script
-f script-file
--file=script-file
If no `-e', `-f', `--expression', or `--file' options are given on the command-line, then the first non-option argument on the command line is taken to be the script to be executed.
If any command-line parameters remain after processing the above, these parameters are interpreted as the names of input files to be processed. A file name of `-' refers to the standard input stream. The standard input will be processed if no file names are specified.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |