Merge remote-tracking branch 'origin/vendor/BINUTILS227'
[dragonfly.git] / tools / tools / locale / tools / whatis.pl
1 #!/bin/sh
2
3 UNIDATA=$(grep ^unidata etc/unicode.conf | cut -f 2 -d " ")
4 UTF8=$(grep ^cldr etc/unicode.conf | cut -f 2 -d " ")/UTF-8.cm
5 CHARMAPS=etc/charmaps
6
7 if [ -z "$1" ]; then
8         echo "Usage: $0 <unicode string>"
9         exit
10 fi
11
12 UCS=$*
13 UCS_=$(echo $* | sed -e 's/ /./g')
14 echo UCS: ${UCS}
15
16 echo UTF-8.cm:
17 grep "${UCS_}" ${UTF8} | sed -e 's/   */        /g'
18
19 echo UNIDATA:
20 grep "${UCS_}" ${UNIDATA}
21 L=$(grep "${UCS_}" ${UNIDATA})
22
23 echo UCC:
24 grep "${UCS_}" ${UNIDATA} | awk -F\; '{ print $1 }'
25
26
27 echo CHARMAPS:
28 grep ${UCS_} ${CHARMAPS}/* | sed -e "s|${CHARMAPS}/||g"
29 grep ${UCC} ${CHARMAPS}/* | sed -e "s|${CHARMAPS}/||g"