Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
math, percentage
- X-seq: zsh-users 9803
- From: "Brian K. White" <brian@xxxxxxxxx>
- To: <zsh-users@xxxxxxxxxx>
- Subject: math, percentage
- Date: Sat, 31 Dec 2005 01:56:35 -0500
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Aljex Software
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