blob: d06e9a0599966ad285596916dc7df96701312b2f [file] [log] [blame]
wkjaa83d772004-05-17 03:22:35 +00001awk '
2BEGIN{
3 print ".nr Rp 1" # supress ... Rx lines
4 first=1
5}
6
7#these come first
8$1=="..." && $2=="Rx"{
9 ref[$4] = $3
10 next
11}
12
13first {
14 printf(".lf %d %s\n", 1, inputfile)
15 lineoffset=NR-1
16 first=0
17}
18
19$1==".Rf"{
20 if($2 in ref)
21 $2=ref[$2]
22 else
23 printf("tref: %s:%d: no ref for %s\n",
24 inputfile, NR-lineoffset, $2) >"/dev/stderr"
25}
26
27{
28 print
29}
30
31' $*