2N/A# Sed script that inserts the file called HEADER before the header entry.
2N/A#
2N/A# At each occurrence of a line starting with "msgid ", we execute the following
2N/A# commands. At the first occurrence, insert the file. At the following
2N/A# occurrences, do nothing. The distinction between the first and the following
2N/A# occurrences is achieved by looking at the hold space.
2N/A/^msgid /{
2N/Ax
2N/A# Test if the hold space is empty.
2N/As/m/m/
2N/Ata
2N/A# Yes it was empty. First occurrence. Read the file.
2N/Ar HEADER
2N/A# Output the file's contents by reading the next line. But don't lose the
2N/A# current line while doing this.
2N/Ag
2N/AN
2N/Abb
2N/A:a
2N/A# The hold space was nonempty. Following occurrences. Do nothing.
2N/Ax
2N/A:b
2N/A}