File: sortflags

package info (click to toggle)
norwegian 2.0.8-2.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,228 kB
  • ctags: 167
  • sloc: perl: 2,665; makefile: 1,621; sh: 201
file content (13 lines) | stat: -rwxr-xr-x 240 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
#
# Sort the affix flags in the munched file alphabetically.

while (<>) {
    chomp;
    if (m%^(.+)/(.*)%) {
	my ($word, $flag) = ($1, $2);
	print "$word/",sort(split(//, $flag)),"\n";
    } else {
	print "$_/\n";
    }
}