scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit 1d19c7bb79c98db394b919a3a01cf1bcbdc8dfd6
parent 4a46d7e426159b0b2994fae939fbc1e0b1694630
Author: z3bra <willy@mailoo.org>
Date:   Sun Feb 15 12:37:47 +0100

mkb is now a compiled program

Diffstat:
mkb | 31-------------------------------
1 file changed, 0 insertions(+), 31 deletions(-)
diff --git a/mkb b/mkb @@ -1,31 +0,0 @@ -#!/bin/sh -# -# z3bra - 2015 (c) wtfpl -# create a nice bar from a percentage - -SIZE=${SIZE:-28} - -CHAR1=${CHAR1:-▣} -CHAR2=${CHAR2:-▣} - -usage() { - echo "usage: $(basename $0) [perc]" >&2 - exit 1 -} - -test -n "$1" && IN=$1 || read IN - -# test the argument given -test $IN -ge 0 || usage -test $IN -le 100 || usage - -BAR= -VAL=$(( IN * SIZE / 100 )) - -for v in `seq 0 $(( SIZE - 1 ))`; do - test "$v" -le "$VAL" \ - && BAR="${BAR}${CHAR1}" \ - || BAR="${BAR}${CHAR2}" -done - -printf "%s\n" "$BAR"