6.4 Examples of Searching
When used with
6.4.1 Examples of Searching and ReplacingThe following examples show the metacharacters available to sed or ex. Note that ex commands begin with a colon. A space is marked by a ; a tab is marked by tab .
Finally, some sed examples for transposing words. A simple transposition of two words might look like this:
s/die or do/do or die/ Transpose words. The real trick is to use hold buffers to transpose variable patterns. For example:
s/\([Dd]ie\) or \([Dd]o\)/\2 or \1/ Transpose, using hold buffers. |
|