w | gawk ' BEGIN { FIELDWIDTHS = "9 11 13 10 8 7 7 14" } NR > 2 { idle = $5 sub(/^ */, "", idle) if ( idle == "" ) idle = 0 if (idle ~ /:/) { split(idle, t, ":") idle = t[1] * 60 + t[2] #Converts idle time into seconds } if (idle ~ /days/) idle *= 24*60*60 print $1, $2, idle }'
Sunday, 14 April 2013
Home »
Shell Scripting
» Shell Scripting ||| To find idle users
0 blogger-disqus:
Post a Comment