#!/bin/bash
# SCCS ID: @(#) GREY-YB nifsort-b.sh SCCS 1.4 <99/04/24 16:02:59>
#
# Copyright (C) 1994-2005 Grey Software.
# All Rights Reserved.
#         Network-I, version 1.4.0b4
# This product is protected by copyright, and distributed under the
# Grey Binary Licence.
#
infile=$1
echo "Niftap Frequency file, sorted by Bytes/Sec\n---------------------------------------------"
tail +3 $infile |
	awk '$1 ~ /Interval/ {printf "%8s%s%12s%s%7s%s\n", "", $1, "", $2, "", $3; next}; $1 ~ /-----/ {print; exit 0}; length >= 0'
cat $infile |
	awk '$2 ~ /[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ {printf "%s %s%16s%18s\n", $1, $2, $3, $4}' |
	sort -rn -k 4 |
	cat -n
