busybox r18513: [ 10 -gt 1000 ] is true?

Clem Taylor clem.taylor at gmail.com
Thu Apr 26 22:20:53 UTC 2007


I upgraded from a 20070312 snapshot to r18513 because of problems with
some applets printing the wrong usage. The usage problem is gone, but
my startup scripts started doing weird things.

It seems that ash now does the following:
[ 10 -gt 10 ] && echo "10 gt 10"
[ 10 -gt 100 ] && echo "10 gt 100"
[ 10 -gt 1000 ] && echo "10 gt 1000"
[ 10 -gt 10000 ] && echo "10 gt 10000"
[ 10 -gt 100000 ] && echo "10 gt 100000"
[ 10 -gt 1000000 ] && echo "10 gt 1000000"
[ 10 -gt 10000000 ] && echo "10 gt 10000000"

This shouldn't print anything, but instead it prints:
10 gt 1000
10 gt 100000
10 gt 10000000

Which is a really weird way to fail. If I use /usr/bin/test instead of
the builtin '[', I see the same behavior. I tried turning off the
CONFIG_*_64 options, but the problem is still present. I'm using
mips/uclibc, but the problem also happens on x86/glibc.

                                   --Clem



More information about the busybox mailing list