yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | #!/usr/local/bin/perl |
2 | $OUTPUT = $ARGV[0]; | ||||
3 | shift(@ARGV); | ||||
4 | |||||
5 | @INPUT = @ARGV; | ||||
6 | |||||
7 | @new_output = sort @INPUT; | ||||
8 | |||||
9 | if(-e $OUTPUT) { | ||||
10 | open(W,">>$OUTPUT") or die "Cannot open $OUTPUT"; | ||||
11 | } else { | ||||
12 | open(W,">$OUTPUT") or die "Cannot open $OUTPUT"; | ||||
13 | } | ||||
14 | |||||
15 | foreach (@new_output) { | ||||
16 | print W "$_ "; | ||||
17 | } | ||||
18 | print W "\n"; | ||||
19 | close(W); | ||||
20 | |||||
21 | |||||
22 | |||||
23 |