gawk-doc: example doesn't match actual output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gawk |
Confirmed
|
Undecided
|
|||
gawk-doc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: gawk-doc
in (gawk.info.
$ echo | awk 'BEGIN { RS = "a" } ; { print NF }'
1
But that's wrong: real results
peter@tesla:~$ echo | gawk 'BEGIN { RS = "a" } ; { print NF }'
0
peter@tesla:~$ echo | gawk --posix 'BEGIN { RS = "a" } ; { print NF }'
1
gawk 1:3.1.6.
I'm not sure what the best thing for the docs to say would be. I assume it's a bug in the docs, not in awk, but I'm not sure.
I'm still trying to figure out what the most concise way to read lines from stdin, and feed them in batches of e.g. 10 lines to the stdin of separate invocations of another command. Probably perl, since awk's RS mechanism doesn't seem to be flexible enough. (I can do it in a perl one-liner, but I was trying to shorten it, and awk's print | command looks useful.)
I reported this bug to the bug-gawk mailing list: http:// lists.gnu. org/archive/ html/bug- gawk/2012- 04/msg00022. html