|
From: | Michael Klement |
Subject: | [bug-gawk] Mistaken interpretation of the POSIX standard causes Gawk 4.1.1 not to recognize newlines as field separators with -P |
Date: | Mon, 25 May 2015 13:08:03 -0400 |
Hi, from the "Variables and Special Variables" section: "a <newline> shall always be a field separator, no matter what the value of FS is." This language is still present in the 2013 edition, (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html). (The unfortunate thing is that the 2004 edition contained sloppy language in the "Description" section, which seemingly contradicts the above:
This has been corrected in the 2013 edition: ) By contrast, Gawk - as of version 4.1.1 - states in its manual under -P, --posix
and acts accordingly (except when RS is set to the empty string). The bottom line is: If the above change in behavior is the only one that -P / --posix effects, this option should never have been introduced in the first place, because Gawks *default* behavior is actually the POSIX-compliant one, and using the option - somewhat ironically - makes Gawk NON-compliant. You can find further discussion and examples at http://stackoverflow.com/a/30406868/45375 Regards, Michael |
[Prev in Thread] | Current Thread | [Next in Thread] |