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