sed [ -n ] [ -u ] Script [ File ... ]
sed [ -n ] [ -u ] [ -e Script ] ... [ -f ScriptFile ] ... [ File ... ]
(2)r RFile
Reads the contents of the RFile variable. It places contents in output before reading the next input line.
(2)s/pattern/replacement/flags
Substitutes the replacement string for the first occurrence of the pattern parameter in the pattern space. Any character that is displayed after the s subcommand can substitute for the /
(slash) separator except for the space or new-line character.
See the "Pattern Matching" section of the ed command.
The value of the flags variable must be zero or more of:
g
Substitutes all non-overlapping instances of the pattern parameter rather than just the first one.
n
Substitutes for the n-th occurrence only of the pattern parameter.
p
Writes the pattern space to standard output if a replacement was made.
w WFile
Writes the pattern space to the WFile variable if a replacement was made. Appends the pattern space to the WFile variable. If the WFile variable was not already created by a previous
write by this sed script, the sed command creates it.
(2)y/pattern1/pattern2/
Replaces all occurrences of characters in the pattern1 variable with the corresponding pattern2 characters. The number of characters in the pattern1 and pattern2 variables must be equal. The
new-line character is represented by \n.
Partager