O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

h

Synopsis

[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
                  /Linux/{
                  h
                  s/.* Linux \(.*\) .*/\1:/
                  p
                  x
                  }

Sample input:

                  This describes the Linux ls command.
This describes the Linux cp command.

Sample output:

ls:
This describes the Linux ls command.
cp:
This describes the Linux cp command.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required