From 1b5b64b0dffda7c538b005e9edfebf9c23bc2a7c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 2 Aug 2008 15:01:40 +0200 Subject: bin/pkg: Optimized clear_line, added colors to progress --- bin/pkg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/pkg b/bin/pkg index 04b62ff..0b41789 100755 --- a/bin/pkg +++ b/bin/pkg @@ -35,11 +35,12 @@ check_valid () { } clear_line () { - echo -ne "\r" + string="\r" for char in {0..80}; { - echo -ne " " + string+=" " } - echo -ne "\r" + string+="\r" + echo -ne $string } # Read local configuration @@ -137,7 +138,7 @@ progress () { clear_line c=$[$currentper/5] a=$[20-$c] - say "$desc [" + say "${info}$desc${reset} [" item $c '=' item $a ' ' say "] $currentper% $desc2" -- cgit v1.2.3