Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

mav3067's scratchpad

by mav3067 (Beadle)
on May 16, 2006 at 20:45 UTC ( [id://549889]=scratchpad: print w/replies, xml ) Need Help??

#!/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
00:00:01 sshd 00:00:01 sshd 00:00:01 sshd 00:00:02 sshd 00:00:02 sshd 00:00:03 sshd 00:00:03 sshd 00:00:05 sshd 00:00:16 sshd 00:00:00 startkde 00:00:00 startkde 00:00:08 syslogd 00:00:00 tail 00:00:00 tail 00:00:00 udevd 00:00:00 vi 00:00:01 vi 00:00:01 vim 00:00:00 wnck-applet 02:33:05 X 00:00:03 xfs 00:00:00 xinetd 00:00:01 xscreensaver
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found