Substitute replacement for
pattern on each addressed line. If pattern
addresses are used, the pattern
// represents the last pattern address
specified. Any delimiter may be used. Use
\ within pattern or
replacement to escape the delimiter. The
following flags can be specified (those marked with a † are
specific to GNU sed ):
Replace n th instance of pattern on each addressed line. n is any number in the range 1 to 512, and the default is 1.
If the substitution was made, execute the contents of the pattern space as a shell command and replace the pattern space with the results.
Replace all instances of pattern on each addressed line, not just the first instance.
Do a case-insensitive regular expression match.
$ to match around a
newline embedded in the pattern space.
Print the line if the substitution is successful. If several successive substitutions are successful, sed prints multiple copies of the line.
Write the line to file if a replacement was done. In Unix sed, a maximum of 10 different files can be opened.
GNU sed allows you
to use the special filenames
/dev/stderr to write to standard
output or standard error, respectively.
Within the replacement, GNU sed accepts special escape sequences, with the following meanings:
Lowercase the replacement text
until a terminating
Lowercase the following character only.
Uppercase the replacement ...