Created
November 15, 2018 11:42
-
-
Save sirolf2009/78058cbf69680a704738f978bd353972 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function progressbar | |
set WHITE "\e[1;37m" | |
set GREEN "\e[1;32m" | |
set GRAY "\e[0;38;2;100;100;100m" | |
set CLEAR "\e[0m" | |
set gaugeSize (expr $argv[3] - 2) | |
set coloredCharsCount (map $argv[1] 0 $argv[2] 0 $gaugeSize) | |
set coloredChars (seq -s= $coloredCharsCount|tr -d '[:digit:]') | |
set grayCharsCount (expr $gaugeSize - $coloredCharsCount) | |
set greyChars (seq -s= $grayCharsCount|tr -d '[:digit:]') | |
echo -e "$WHITE""[""$GREEN""$coloredChars""$GRAY""$greyChars""$WHITE""]""$CLEAR" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment