diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-18 18:08:51 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-02-18 18:08:51 +0100 |
| commit | 798ed274c84f265bdf9a28fd171ff36807ff1b27 (patch) | |
| tree | de94fe4cd2269e73269ee4f25c7a0211002490c8 /.local/bin/bar | |
| parent | 8b8325da143e88cc1144f5ddc26f717d9b98aafd (diff) | |
dotfiles changes
Diffstat (limited to '.local/bin/bar')
| -rwxr-xr-x | .local/bin/bar | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/.local/bin/bar b/.local/bin/bar new file mode 100755 index 0000000..39267a6 --- /dev/null +++ b/.local/bin/bar @@ -0,0 +1,19 @@ +#!/bin/sh + +STEPS=10 + +repeat() { + printf %${2}s | sed -e "s/ /$1/g" +} + + +usage=$(expr $1 \* $STEPS / 100) + +if [ "$usage" -gt "$STEPS" ]; then + usage=$STEPS +fi + +printf "" +repeat "" "$usage" +repeat "" "$(expr $STEPS - $usage)" +printf "\n" |