Usage: sed [OPTION]... SCRIPT [FILE]...
Allowed sed scripts come in the following form:
ADDR [!] COMMAND |
ADDR can be:
NUMBER Match specified line number $ Match last line /REGEXP/ Match specified regexp |
! inverts the meaning of the match
COMMAND can be:
s/regexp/replacement/[igp] which attempt to match regexp against the pattern space and if successful replaces the matched portion with replacement. aTEXT which appends TEXT after the pattern space |
This version of sed matches full regular expressions.
Options:
-e Add the script to the commands to be executed -n Suppress automatic printing of pattern space |
Example:
$ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g' bar |