|
From: | Ed Morton |
Subject: | [bug-gawk] Unstated differences between gawk and POSIX |
Date: | Thu, 2 Aug 2018 10:30:59 -0500 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
1) POSIX states that a numeric-string vs numeric-string comparison should be a string comparison but gawks does a numeric comparison. 2) POSIX states that an uninitialized field (e.g. $3 or higher when you only have 2 input fields) should have the same value as an uninitialized array element or scalar variable and that value is zero-or-null but in a comparison gawk treats an uninitialized field as a string with value null only.
You can see the comp.lang.awk question for details and references if you're interested. I think it's POSIX that should change to match gawks behavior (which is also the behavior of at least some other awks) rather than the other way around but idk how to make that happen (yet) or if/when it will happen, nor do I know if gawk should have something documented about the differences meantime so I at least wanted to give you a heads up about the issues and you can decide if anything should change on the gawk tool or documentation side.
Ed.
[Prev in Thread] | Current Thread | [Next in Thread] |