Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: math, percentage
- X-seq: zsh-users 9805
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: "Brian K. White" <brian@xxxxxxxxx>
- Subject: Re: math, percentage
- Date: Sat, 31 Dec 2005 01:25:00 -0600
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <024d01c60dd7$576ed990$931fa8c0@venti>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <024d01c60dd7$576ed990$931fa8c0@venti>
In the last episode (Dec 31), Brian K. White said:
> 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
(( tp=t*100/T ))
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author