Next Hold Space 17

Heading translation in sed

  • sed semantics:

    • read lines one at a time into the pattern space

    • examine elements of the script one at a time for matching patterns

      • execute matching commands

    • after executing the script, print the pattern space

      • (unless interrupted by the d or q command)

  • Problem: no variables

    • No problem—sed has a "hold space"

    • Use it for holding data for later processing

    • x command exchanges hold and pattern spaces


Next Next