NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/53507: awk doesn't properly compare "numeric strings"



-4: awk 'BEGIN { max="80" ; for (i=0; i<max; i++) {print i}; exit}' | wc -l
      9
hm, why 9? Maybe counts 0 to 8?

The string "8" is less than "80"

-5: awk 'BEGIN { max="90" ; for (i=0; i<max; i++) {print i}; exit}' | wc -l
     90
And now? 90 is ok - or not?

Seems that 1-8 are "special" and 9 is handled as expectet?

And, since "9" is less than "90" it will increment i and continue until
we compare "90" vs "90"


+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index