Reference: h
Author: Daniel Gilly & the Staff of O'Reilly & Associates
Date: 1998-08-06T22:00:15Z

#

| Chapter 10 The Sed Editor |

## h

    [address1][,address2]h

Copy the pattern space into the hold space, a special temporary buffer. The previous contents of the hold space are obliterated. You can use h to save a line before editing it.

### Example

>     # Edit a line; print the change; replay the original
>     /UNIX/{
>     h
>     s/.* UNIX \(.*\) .*/\1:/
>     p
>     x
>     }

Sample input:

>     This describes the UNIX ls command.
>     This describes the UNIX cp command.

Sample output:

>     ls:
>     This describes the UNIX ls command.
>     cp:
>     This describes the UNIX cp command.

Reference: G |  | Reference: H