SED substitutions

We'll cover the following...

The format for the substitute command is as follows:

    [address1[ ,address2]]s/pattern/replacement/[flags] 

The flags can be any of the following:

  • n replace nth instance of pattern with replacement
  • g replace all instances of pattern with replacement
  • p write pattern space to STDOUT if a successful substitution takes place
  • w file Write the pattern space to file if a successful substitution takes place
...