Skip to content

Instantly share code, notes, and snippets.

View rodw's full-sized avatar

Rod Waldhoff rodw

View GitHub Profile
@rodw
rodw / draw-histogram.sh
Created February 26, 2018 21:04
bash script that generates an ASCII-art histogram (bar chart) from input data.
#!/bin/bash
#-------------------------------------------------------------------------------
# draw-histogram - generates an ASCII-art histogram (bar chart) from input data.
#-------------------------------------------------------------------------------
# Expects a series of lines of the form `<category-name> <count>` to passed
# via stdin.
#
# Generates a table the looks something like the following:
#
# +-------+----+