Skip to content

Instantly share code, notes, and snippets.

@amtseng
amtseng / histogram.sh
Last active April 20, 2022 16:03
Simple commandline program to construct ASCII histograms
set -beEo pipefail
DEFAULTNUMBINS=10
DEFAULTMAXWIDTH=75
show_help() {
cat << EOF
Usage: ${0##*/} [OPTIONS]
Takes a set of numbers and plots an ASCII histogram. The input must be fed in
through stdin, and must consist of one number on each line.