From b92c8aa4bccd23eacd1a2921dd2535ea1928bdf3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 2 Aug 2008 21:11:18 +0200 Subject: bin/pkg: progress: Buffer output for less flickering with ssh --- bin/pkg | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/pkg b/bin/pkg index 83c43f3..62479da 100755 --- a/bin/pkg +++ b/bin/pkg @@ -127,22 +127,21 @@ progress () { max=$2 desc=$3 desc2=$4 + output='' currentper=$[$[$current*100]/$max] - say () { - [[ $SILENT = 1 ]] || echo -ne $* - } item () { for j in {0..$1}; { - [[ $j -gt 0 ]] && say $2 + [[ $j -gt 0 ]] && output+=$2 } } clear_line c=$[$currentper/5] a=$[20-$c] - say "${info}$desc${reset} [" + output+="${info}$desc${reset} [" item $c '=' item $a ' ' - say "] $currentper% $desc2" + output+="] $currentper% $desc2" + [[ $SILENT = 1 ]] || echo -ne $output } ## VCS Wrappers -- cgit v1.2.3