Re: [Aoetools-discuss] [PATCH] remove bc usage
Brought to you by:
ecashin,
elcapitansam
From: Andrei L. <an...@la...> - 2006-09-20 16:11:27
|
Warren Turkal wrote: > Here's a patch to remove bc usage in aoe-stat. I replaced bc with shell > arithmetic. Also aoe-mkshelf uses bc. I find it when I packaged aoetools for Slax: http://www.slax.org/modules.php?category=network&id=1629&name=aoetools+%28ATA+over+Ethernet+Tools%29 Andrei > > --- aoetools-10/aoe-stat 2005-10-18 11:11:22.000000000 -0600 > +++ aoetools-10.new/aoe-stat 2006-09-19 17:55:34.806586510 -0600 > @@ -21,7 +21,7 @@ > > dev=`echo "$d" | sed 's/.*!//'` > sectors="`cat \"$d/size\"`" > - psize=`echo "(512000 * $sectors) / (1000 * 1000 * 1000)" | bc` > + psize=`echo $(( (512000 * $sectors) / (1000 * 1000 * 1000) ))` > psize=`printf "%04d\n" $psize | sed 's!\(...\)$!.\1!'` > printf "$format" \ > "$dev" \ > > I don't see any reason to use bc in such a simple case. > > wt -- Lan.Art s.r.l. via Co' del Panico 36/1 35028 Piove di Sacco (PD) tel. 049-7966424 fax 049-7966600 http://www.lanart.it |