changeset 602:8de4598dfe46

Add percent progress indicator to miniconfig creation script.
author Rob Landley <rob@landley.net>
date Thu, 29 Jan 2009 15:13:47 -0600
parents df62eeaccb27
children 524215827ef8
files sources/toys/miniconfig.sh
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sources/toys/miniconfig.sh	Thu Jan 29 00:00:46 2009 -0600
+++ b/sources/toys/miniconfig.sh	Thu Jan 29 15:13:47 2009 -0600
@@ -52,6 +52,7 @@
 echo "Calculating mini.config..."
 
 LENGTH=`cat mini.config | wc -l`
+OLDLENGTH=$LENGTH
 
 # Loop through all lines in the file 
 I=1
@@ -73,7 +74,7 @@
   else
     I=$[$I + 1]
   fi
-  echo -n -e "\r$[$I-1]/$LENGTH lines $(cat mini.config | wc -c) bytes   "
+  echo -n -e "\r$[$I-1]/$LENGTH lines $(cat mini.config | wc -c) bytes $[100-((($LENGTH-$I)*100)/$OLDLENGTH)]% "
 done
 rm .big.config
 echo