Various shell scripts for use on the RTC server. Not your official RTC stuff!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
399 B

#! /bin/sh
recent |\
awk '
function hist(x,m){
return sprintf("%-20s\n", substr("####################",0,int(20*(x/max))))
}
BEGIN{
#printf("%-10s %-20s\n","Date","Activity")
}
{
a[$4]++
max=a[$4]>max?a[$4]:max
}
END{
for (d in a) {
printf("%3d %15.15s %-20.20s\n",a[d], d,hist(a[d],max))
}
}'|\
sort -k1r,2n