The '
h' command copies the matching lines into the hold buffer, then the '
p' command prints the line. But you never do anything with the hold buffer after you copy to it, so it's as if the '
h' command doesn't exist.
You have to include another expression that moves the contents of the hold buffer back into the pattern buffer for it to have any use.
If you haven't seen it yet, the grymoire tutorial has a good lineup on multi-line use:
http://www.grymoire.com/Unix/Sed.html#uh-47
(Frankly, I've never been able to fully understand the use of the hold buffer though. I get the concept, but getting the flow control to come out correctly always seems to hang me up.)