#!/bin/sh if [ ! -f $1 ]; then echo "file not found." exit 1 fi LOG=$1 cat $LOG | grep " @in " | awk '{printf("%s %s\n", $1, $5)}' | sort | uniq -c | sort -r exit 0