Steffen Nurpmeso wrote in
 <20221107194134.i5yn8%stef...@sdaoden.eu>:
 |I do not know how portable / desired, but stumbled upon
 |
 |  #?0|kent:src$ printf 'a\0b\0c\0' | gawk 'BEGIN{FS="\0"} {for(i=0; \
 |  i < NF; ++i) print i, $i}'
 |  0 abc
 |  1 a
 |  2 b
 |  3 c
 |  #?0|kent:src$ printf 'a\0b\0c\0' | mawk 'BEGIN{FS="\0"} {for(i=0; \
 |  i < NF; ++i) print i, $i}'
 |  0 abc
 |  1 a
 |  2 b
 |  3 c
 |  #?0|kent:src$ printf 'a\0b\0c\0' | nawk 'BEGIN{FS="\0"} {for(i=0; \
 |  i < NF; ++i) print i, $i}'
 |  0 a
 |  #?0|kent:src$ printf 'a\0b\0c\0' | busybox.static awk 'BEGIN{FS="\0"} \
 |  {for(i=0; i < NF; ++i) print i, $i}'
 |  0 a
 |  0 b
 |  0 c
 |
 |For nawk this is https://github.com/onetrueawk/awk/issues/165.

They closed it after Arnold "Aharon" Robbins from [gn]awk stated
that whereas gawk uses pointer+length to store strings, nawk only
uses C-style strings.  It would thus require a massive change.
(He also pointed out that POSIX states the behaviour is undefined
in the case, and that awk was made for text not binary thus NUL is
not expected to happen.)

For busybox however i still find the behaviour odd, and i would
love to see it en par with [gm]awk.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to