#!/bin/bash # -*- sh -*- # Takes on stdin a file formated like the official UnicodeData list; # Writes on stdout a list of chars that don't get a fallback if [ $# != 2 ] then echo >&2 "Usage: $(basename $0) FULL_PATTERN HOPEFULL_PATTERN" echo >&2 " < UnicodeData-2.txt >out.nofallback" exit 1 fi FULL_PATTERN=$1 HOPEFULL_PATTERN=$2 FILE=/tmp/file.$$ cut -d\; -f1,2 >$FILE cat << EOF # # List of characters matching: # '${HOPEFULL_PATTERN}' # that don't get a fallback using: # FULL_PATTERN='${FULL_PATTERN}' # # Auto-generated by $(basename $0) from UnicodeData list # # ** DO NOT EDIT MANUALLY ** # EOF egrep < $FILE -f <(echo ";${HOPEFULL_PATTERN}") | egrep -v -f <(echo ";${FULL_PATTERN}$") rm $FILE