Geoff Clare wrote in
<Y5IfitYcOycon41b@localhost>:
|Stephane Chazelas wrote, on 08 Dec 2022:
|> 2022-12-08 15:39:32 +0000, Austin Group Bug Tracker via austin-group-l \
|> at The Open Group:
|> [...]
|>> It is looking like the group might decide to add find -print0 and \
|>> related
|>> xargs and read features (for reasons I won't go into here).
|> [...]
...
|> Is there any plan of adding the accompanying [.]
|> [.] awk -v RS='\0' -v ORS='\0' that some awk
|> implementations still don't support (that support currently not
|> mandated by POSIX)).
|
|There are no plans for that. And given the short time available
|before we produce draft 3, I doubt it would be feasible for Issue 8.
|(New features need to be in draft 3 if they are going to make it
|into Issue 8 rather than waiting for Issue 9.)
Just to add that i opened an issue for nawk (Kernighan's awk) [1]
where i said "I do not know how portable / desired, but" regarding
printf 'a\0b\0c\0' |
awk 'BEGIN{FS="\0"} {for(i=0; i < NF; ++i) print i, $i}'
which works in GNU awk and mawk (Dickey's mawk, i no longer test
against the broken 1990's mawk Debian used until not too long
ago), but outputs "0 a" for nawk and
0 a
0 b
0 c
for busybox awk (git current some ~one month ago).
The issue was then closed by Arnold "Aharon" Robbins (also of GNU
awk) with the words[2]
The One True Awk uses C strings, which are zero terminated, for
just about everything. Thus a record of "a\0\b\0c\0" looks the
same as if all it had was "a". Gawk uses pointer +
length for all strings, so it can handle something like FS
= "\0". In any case, putting NUL bytes into data isn't portable
and is also outside the scope of POSIX, which expects data
to be text, and not binary.
So i would expect this to be a major effort for one of the most
widely used awk implementations. (And Kernighan seems to play
around with adding Unicode support on a feature branch, without
any thoughts on a NUL FS a short glance suggests.)
[1] https://github.com/onetrueawk/awk/issues/165
[2] https://github.com/onetrueawk/awk/issues/165#issuecomment-1306699359
--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)