From ff81062fc74a6a06993fca95d44edaaa18279bb5 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 27 Jul 2009 14:36:32 -0700 Subject: Sort lines in show-queuing --brief Sort output lines Bug 3896 --- scripts/vyatta-show-queueing.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/vyatta-show-queueing.pl b/scripts/vyatta-show-queueing.pl index 3d3239b..5dfca4b 100755 --- a/scripts/vyatta-show-queueing.pl +++ b/scripts/vyatta-show-queueing.pl @@ -69,12 +69,12 @@ sub show_brief { # Read qdisc info open( my $tc, '/sbin/tc -s qdisc ls |' ) or die 'tc command failed'; + my @lines; my ( $qdisc, $parent, $ifname, $id ); while (<$tc>) { chomp; my @fields = split; if ( $fields[0] eq 'qdisc' ) { - # qdisc sfq 8003: dev eth1 root limit 127p quantum 1514b ( undef, $qdisc, $id, undef, $ifname, $parent ) = @fields; next; @@ -100,10 +100,11 @@ sub show_brief { next unless ( $intf && ( $intf->type() eq $intf_type ) ); } - printf $fmt, $ifname, shaper($qdisc), $sent, $drop, $over; + push @lines, sprintf $fmt, $ifname, shaper($qdisc), $sent, $drop, $over; } } close $tc; + print sort @lines; if (%ingress) { print "\nInput:\n"; -- cgit v1.2.3