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