Created
January 10, 2020 15:36
-
-
Save bougui505/9846e4efde9afee2e48397e7faa04ab0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# -*- coding: UTF8 -*- | |
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr | |
# https://research.pasteur.fr/en/member/guillaume-bouvier/ | |
# 2020-01-10 16:20:44 (UTC+0100) | |
# Simple bar chart plotting in a terminal by reading integer from stdin | |
# FIELD: Field number to read the value from | |
if [ "$#" -ne 1 ]; then | |
FIELD=1 | |
else | |
FIELD=$1 | |
fi | |
cat /dev/stdin | awk -v FIELD=$FIELD '{printf $0" "; for (i=1;i<=$FIELD;i++){printf "+"};printf "\n"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment