rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [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 |