Date: Fri, 05 Jul 2013 23:52:45 +0200 From: Steffen "Daode" Nurpmeso <sdaoden@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/180328: awk(1) fails to treat var as integer Message-ID: <20130705225245.RVeyMxxz46u4iFEvlVyjjeiM@dietcurd.local> In-Reply-To: <201307051720.r65HK1tN020084@freefall.freebsd.org> References: <201307051720.r65HK1tN020084@freefall.freebsd.org>
index | next in thread | previous in thread | raw e-mail
Hello.
uwe@netbsd prodded that i dig a bit deeper and so here is the
thing a bit narrowed down. Sorry.
| Please, can you minimize the test case? As far as I understand it
| should be reducible to the script and to a single line of input that
| triggers the problem.
Hmmm.
cat > test.sh <<\!
printf '1 '; printf "F0000\n" |
awk '{r2 = r1 = sprintf("%d", "0x" $1); while (r1 <= r2) {print r1; ++r1}}'
printf '2 '; printf "F0000\n" |
awk '{r1 = sprintf("%d", "0x" $1); r2 = r1; while (r1 <= r2) {print r1; ++r1}}'
printf '3 '; printf "F0000\n" |
awk '{r1 = sprintf("%d", "0x" $1); while (r1 <= 983040) {print r1; ++r1}}'
printf '4 '; printf "F0000\n" |
awk '{r1 = sprintf("%d", "0x" $1); r2 = sprintf("%d", "0x" $1); while (r1 <= r2) {print r1; ++r1}}'
printf '5 '; printf "F0000\n" |
awk '{r1 = sprintf("%d", "0x" $1); r2 = sprintf("%d", "0x" $1); while (r1 <= r2) {print r1; ++r1}}'
printf '6 '; printf "F0000 F0001\n" |
awk '{r1 = sprintf("%d", "0x" $1); r2 = sprintf("%d", "0x" $1); while (r1 < r2) {print r1; ++r1}}'
sh ./test.sh
results in
1 983040
2 983040
3 983040
4 983040
5 983040
6
So -- indeed. Sorry.
| -uwe
--steffen
But
$ make ucd; ll test/sa/t_props.dat; make ucd-clean;\
sed -e 40d -i '' tools/t-base.t; make ucd; ll test/sa/t_props.dat
becomes (when i strip all the other messages)
ucd: ok
4956 -rw-rw-r-- 1 steffen staff 5071362 5 Jul 23:40 test/sa/t_props.dat
ucd-clean: ok
...
ucd: ok
4188 -rw-rw-r-- 1 steffen staff 4284954 5 Jul 23:40 test/sa/t_props.dat
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130705225245.RVeyMxxz46u4iFEvlVyjjeiM>
