Re: [Ninux-Wireless] problem with big integer on openwrt

2010-07-15 Per discussione pi...@piumalab.org
On 07/15/2010 12:01 PM, Gioacchino Mazzurco wrote: > The problem is not Openwrt but awk that cannot handle big number on small > device :( > > bash can than i fixed with this > > printf "%d\n" $(( (`echo "255.255.255.255" | awk -F\. '{printf "%d", > ($4)}'`)+ (256*`echo "255.255.255.255" | awk -F\.

Re: [Ninux-Wireless] problem with big integer on openwrt

2010-07-15 Per discussione Gioacchino Mazzurco
The problem is not Openwrt but awk that cannot handle big number on small device :( bash can than i fixed with this printf "%d\n" $(( (`echo "255.255.255.255" | awk -F\. '{printf "%d", ($4)}'`)+ (256*`echo "255.255.255.255" | awk -F\. '{printf "%d", ($3)}'`) + (256*256*`echo "255.255.255.255" | a

Re: [Ninux-Wireless] problem with big integer on openwrt

2010-07-15 Per discussione Luca Dionisi
I think awk could be the point. My system (ubuntu) gives the correct answer. l...@luca-laptop:~$ which awk /usr/bin/awk l...@luca-laptop:~$ file /usr/bin/awk /usr/bin/awk: symbolic link to `/etc/alternatives/awk' l...@luca-laptop:~$ file /etc/alternatives/awk /etc/alternatives/awk: symbolic link t

[Ninux-Wireless] problem with big integer on openwrt

2010-07-15 Per discussione Gioacchino Mazzurco
Hey all I have a big problem with openwrt! In a bash shell if i write this command printf "%d\n" "`echo "255.255.255.255" | awk -F\. '{printf "%d", ($4)+($3*256)+($2*256*256)+($1*256*256*256)}'`" i obtain 2147483647 that is wrong! If i put the same command in my gentoo bash shell i obtain 429496