4

GitHub - TurkeyMcMac/barchart: Make bar charts on the terminal.

 2 years ago
source link: https://github.com/TurkeyMcMac/barchart
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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 Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK