Andrew Suffield wrote: > > Hrngh. You're right, busybox dc is not a correct implementation of > posix dc. I think that means you're screwed. To hell with it, and > depend on bc for arithmetic?
Hence, the proposed function to compare two addresses:
addr_comp() {
test $(bc <<EOF
$1 > $2
EOF
) -eq 1
}
That will sure make your parents proud. To compare two numbers, you only
have to fork(), pipe(), exec(), ...
Brian: If you copy/paste the above into your BusyBox shell, do you get these
results?
$ addr_comp 2953838592 1107296256 && echo Yes || echo No
Yes
$ addr_comp 1107296256 2953838592 && echo Yes || echo No
No
$
-Tom
--
Tom Eastep \ Nothing is foolproof to a sufficiently talented fool
Shoreline, \ http://shorewall.net
Washington USA \ [EMAIL PROTECTED]
PGP Public Key \ https://lists.shorewall.net/teastep.pgp.key
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Shorewall-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-users
