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