We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3698eb commit c3a1f18Copy full SHA for c3a1f18
hist
@@ -0,0 +1,13 @@
1
+#!/bin/sh
2
+# Reads data from STDIN and draws a frequency histogram. -r assumes
3
+# pre-aggregated data
4
+# Usage: hist [-r] [plot function] [plotchar]
5
+# "plot function" is any valid perl expression, with "x" being the value.
6
+f(){ sort | uniq -c; }
7
+if [ "$1" = '-r' ]; then
8
+ f() cat
9
+ shift
10
+fi
11
+e="$(printf '%s' "${1:-x}" | perl -pe 's/x/\$F[0]/g;s/\\\$F\[0\]/x/g')"
12
+c="${2:-#}"
13
+f | perl -lane 'print "$F[1]\t$F[0]\t", "'"$c"'"x('"$e"')'
0 commit comments