shithub: bin.rc

ref: 1bab993af3da2ba2ee9e84d8602c9ae67f7c58d1
dir: /bin/hist/

View raw version
#!/bin/awk -f
function rep(s, n,		t) {
	n = int(n / (max+1) * 60)
	while (n--)
		t = t s
	return t
}
{ x[int($1/10)]++ }
END {
	for (i = 0; i < 10; i++)
		if (x[i] > max) max = x[i]
	for (i = 0; i < 10; i++)
		printf("%-10d - %s\n", x[i], rep("*", x[i]))
}