[Ninux-Wireless] problem with big integer on openwrt

Gioacchino Mazzurco gmazzurco89 a gmail.com
Gio 15 Lug 2010 12:01:20 CEST


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" | awk -F\. '{printf "%d", ($2)}'`) +
(256*256*256*`echo "255.255.255.255" | awk -F\. '{printf "%d", ($4)}'`) ))

2010/7/15 Gioacchino Mazzurco <gmazzurco89 a gmail.com>

> 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  4294967295 that
> is the good value how to fix this ?
>
-------------- parte successiva --------------
Un allegato HTML รจ stato rimosso...
URL: <http://ml.ninux.org/pipermail/wireless/attachments/20100715/7dd54807/attachment-0001.html>


Maggiori informazioni sulla lista Wireless