1*f8dd34f6Sespie# Sed script that inserts the file called HEADER before the header entry.
2*f8dd34f6Sespie#
3*f8dd34f6Sespie# At each occurrence of a line starting with "msgid ", we execute the following
4*f8dd34f6Sespie# commands. At the first occurrence, insert the file. At the following
5*f8dd34f6Sespie# occurrences, do nothing. The distinction between the first and the following
6*f8dd34f6Sespie# occurrences is achieved by looking at the hold space.
7*f8dd34f6Sespie/^msgid /{
8*f8dd34f6Sespiex
9*f8dd34f6Sespie# Test if the hold space is empty.
10*f8dd34f6Sespies/m/m/
11*f8dd34f6Sespieta
12*f8dd34f6Sespie# Yes it was empty. First occurrence. Read the file.
13*f8dd34f6Sespier HEADER
14*f8dd34f6Sespie# Output the file's contents by reading the next line. But don't lose the
15*f8dd34f6Sespie# current line while doing this.
16*f8dd34f6Sespieg
17*f8dd34f6SespieN
18*f8dd34f6Sespiebb
19*f8dd34f6Sespie:a
20*f8dd34f6Sespie# The hold space was nonempty. Following occurrences. Do nothing.
21*f8dd34f6Sespiex
22*f8dd34f6Sespie:b
23*f8dd34f6Sespie}
24