#! /bin/sh

# check uniqueness of character mnemonics

mnemodups () {
	sed -e 's,"[^"]*$,,' -e 's,^	{",,' -e t -e d $* | 
	sort | uniq -d
}

mnemodupats () {
	sed -e 's/", [^"]*$/", /' -e t -e d $* | 
	sort | uniq -d
}

files=${*-mnemos.???}
tmp=/tmp/mnemodupats
out=/tmp/mnemodups

mnemodupats $files > $tmp
fgrep -f $tmp $files | sort +1 > $out
fgrep -v -f mnemos.virtual-dups $out

rm -f $tmp $out
