aboutsummaryrefslogtreecommitdiffstats
path: root/fch
blob: 361dea0bf15ac8480c6f35f4a558928cc8f96b47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/awk -f

# fch: find a unicode character
# Requires plan9port to be installed at /opt/plan9

BEGIN {
	if (ARGC < 2) {
		print "Usage: fch <charname>"
		exit 2
	}

	charname = ARGV[1]
	for (i = 2; i < ARGC; i++)
		charname = charname" "ARGV[i];

	while (getline <"/opt/plan9/lib/unicode")
		if (match($0, charname)) {
			desc = substr($0, length($1)+1, length($0))
			"9 unicode " $1 | getline char; close(char)
			printf "%s%s\n",char,desc
		}
}