On 2020-01-10, at 23:26:15, enh via tz <tz@iana.org> wrote:
NetBSD already supported regular expressions in RS, and they upstreamed that to one-true-awk last year (https://github.com/onetrueawk/awk/commit/643a5a3dad633431c6ce8831944c23059a6... and https://github.com/onetrueawk/awk/commit/7cae39dfa53e17981990f649a2f6b4c1ba8...) so hopefully all the OSes not using gawk can unify at some point. but, yeah, right now most awks don't have this ability. (for Android builds we're actually using one-true-awk on both Linux and macOS so developers working on one can't break developers working on the other.)
POSIX rules. Why take a chance to depend on leading edge features?: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_0... ... RS ... If RS contains more than one character, the results are unspecified. ...
On Fri, Jan 10, 2020 at 9:31 PM Deborah Goldsmith via tz <tz@iana.org> wrote:
Would it make sense to just use tr to strip carriage returns from the file before feeding it to the awk script?
No need. A sub() rule fixes it compatibly. Patch attached. Tested on MacOS Mojave with simulated a la NIST input. -- gil