File: sortkoi8

package info (click to toggle)
rus-ispell 0.99g5-8.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,088 kB
  • ctags: 18
  • sloc: makefile: 112; ansic: 62; sh: 15
file content (16 lines) | stat: -rwxr-xr-x 583 bytes parent folder | download | duplicates (12)
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