c33s / barchart

Make bar charts on the terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BARCHART
========

This program makes bar charts. For example, take this file 'data':

33 This is a label
 0 This is another
100
80 The line above had no label  

Running './barchart -w 80 data' would produce:

 33 This is a label             ################
  0 This is another             
100                             ################################################
 80 The line above had no label #######################################

The script should work with any POSIX shell. However, it can only automatically
detect terminal width if the 'size' operand to 'stty' is present and the
controlling terminal is available as '/dev/tty'.

This script integrates well into pipelines. For example, this makes a bar chart
of line counts for all source files in 'src':

find -L src -type f -exec wc -l {} \; | sort -rn | barchart | less

About

Make bar charts on the terminal.

License:MIT License


Languages

Language:Shell 100.0%