summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/ruhyphen/sortkoi8
blob: ac990400ba3ad838c8e0bd0ccc5137a25877cf0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# sort a file in Cyrillic koi8-r encoding alphabetically
#
# -f Fold lower case characters into the equivalent upper case
#    characters when sorting so that, for example, `B' is greater
#    than `a' (without `-f', uppercase characters precede lowercase).

if [ "$1" = "-f" ]; then
	FOLD="-f"
	ALPH='áÁâÂ÷×çÇäÄåų£öÖúÚéÉêÊëËìÌíÍîÎïÏðÐòÒóÓôÔõÕæÆèÈãÃþÞûÛýÝÿßùÙøØüÜàÀñÑ'
else
	ALPH='áâ÷çäå³öúéêëìíîïðòóôõæèãþûýÿùøüàñÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ'
fi
TEMP='¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'

tr $ALPH $TEMP | sort $FOLD | tr $TEMP $ALPH