|
From: | david kerns |
Subject: | Re: [bug-gawk] Documentation or POSIX / compatibility mode bug |
Date: | Tue, 26 Apr 2016 08:25:19 -0700 |
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 # brokenThis 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
[Prev in Thread] | Current Thread | [Next in Thread] |