#!/bin/bash #for x in `grep -P -o ".*" out` cat out | cut -f 2 | uniq -c | sort -gr | while read x do command=`echo $x | grep -o "[^ ]\{2,\}$"` invoc=`echo $x | grep -o "^[0-9]\{1,\}"` time=0 for z in `grep "\s$command\s" out | tr -s " " "*"` do time2=`echo $z | cut -d "*" -f 3` time3=`date -d "January 1 1970 ${time2} UTC" +%s` time=`expr $time + $time3` done outtime=`date -d "00:00 ${time} seconds" +%T` echo -e "$command \t $invoc \t $outtime" done