I'm writing in regard to a bug afflicting the latest version of Gawk (4.1.3).
The bug is either in Gawk's documentation (namely in the `man` page) or in Gawk's behavior in POSIX / compatibiliy mode.
Quoting the relevant part under the section "Records" in the `man` page:
"in compatibility mode, only the first character of its string value is used for separating records."
However that doesn't seem to be the case: neither `-P` (which per the `man` page turns on compatibility mode) nor `-c` seem to affect how the value of `RS` is intepreted in order to split records; basically, the value of `RS` is apparently always interpreted as a regular _expression_.
% ./gawk -- '1' RS="b.*" <<<'foobarfoo'
foo # ok
% ./gawk -P -- '1' RS="b.*" <<<'foobarfoo'
foo # broken
% ./gawk -c -- '1' RS="b.*" <<<'foobarfoo'
foo # broken
This on the latest version (4.1.3).
So either that's the expected behavior (and the bug is in the `man` page)
or the compatibility mode (and consequently also the POSIX mode) are currently broken.
Best regards,
Glauco Ciullini