aboutsummaryrefslogtreecommitdiff
path: root/kike-extract-messages.sh
blob: 9438695fa0fd43510673d2fa12ce12ca413e2165 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
LC_ALL=C exec awk '
	BEGIN {
		print "$quote \"";
		print "$set 1";
	}
	/^\tIRC_(ERR|RPL)_[A-Z]+ *= *[0-9]+,?$/ {
		match($3, /^[0-9]+/);
		id[$1] = substr($3, RSTART, RLENGTH);
	}
	/^\t\[IRC_(ERR|RPL)_[A-Z]+\] *= *".*",?$/ {
		z = substr($1, 2, length($1) - 2);
		match($0, /".*"/);
		print id[z] " " substr($0, RSTART, RLENGTH);
	}'