Help for this page

Select Code to Download


  1. or download this
    sub sort_by_intf # sort interface alpha/number name mixture properly
    { my $A = $a;    # just turn any number into a 0004 digit one
    ...
      $B =~ s/([0-9]+)/ sprintf "%04d",9999-$1 /ge;
      $B cmp $A; # reverse order happens to be useful here:
    }            # Tun0, Ser1, Port-channel2, Gi3, Fa4, Eth5
    
  2. or download this
    for (sort sort_by_intf keys %ifSpeed) {
      printf "intf: %s,  speed: %d\n" $_, $ifSpeed{$_};
    }