Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

math, percentage



is there a way to do this with built in math instead of running bc ?

tp=`echo "scale=0;(${t}*100)/$T" |bc`

T = some dynamic total number like `ls |wc -l`
t = counter that starts at 1 and incriments as a loop walks through T
tp = percent of total job completed so far

Thanks
Brian K. White  --  brian@xxxxxxxxx  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



Messages sorted by: Reverse Date, Date, Thread, Author