summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-10-21 14:59:40 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-10-21 14:59:40 -0700
commitb2b20a22373f96699484d7615fa50bb7eec801f2 (patch)
treed97c508dc4f51354d749ea0e5659910d571481da
parent64a061562ffe5af7036a4caac16ef51ad1efd724 (diff)
downloadvyatta-cfg-b2b20a22373f96699484d7615fa50bb7eec801f2.tar.gz
vyatta-cfg-b2b20a22373f96699484d7615fa50bb7eec801f2.zip
fixed script to handle multiple entries for same priority
-rw-r--r--scripts/priority.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/priority.pl b/scripts/priority.pl
index a8cf9b6..59239bf 100644
--- a/scripts/priority.pl
+++ b/scripts/priority.pl
@@ -9,8 +9,8 @@ foreach my $f (@files) {
if (defined $result && length($result) != 0) {
my @r = split " ", $result;
if (defined $r[1]) {
- $pri{$r[1]} = $f;
#stuff in hash here
+ push @{$pri{$r[1]}},$f;
}
}
}
@@ -19,7 +19,10 @@ foreach my $f (@files) {
#now sort
foreach my $key ( sort { $a <=> $b } keys %pri ) {
- my $loc = substr($pri{$key},0,-10);
- my $loc = substr($loc,39);
- print $key," ",$loc,"\n";
+ my @a = @{$pri{$key}};
+ foreach my $val (@a) {
+ my $loc = substr($val,0,-10);
+ my $loc = substr($loc,39);
+ print $key," ",$loc,"\n";
+ }
}