3 ms·
I thought the gawk book/documentation [1] did a good job of mentioning differences between various implementations, do you have an example? You might find this
by asicsp 7y ago
I thought the gawk book/documentation [1] did a good job of mentioning differences between various implementations, do you have an example?
You might find this [2] helpful (oops, seems like it got deleted, see [3] - thanks @bionoid)
[1] https://www.gnu.org/software/gawk/manual/gawk.html https://www.gnu.org/software/gawk/manual/gawk.html
[2] https://www.reddit.com/r/awk/comments/4omosp/differences_between_gawk_nawk_mawk_and_posix_awk/ https://www.reddit.com/r/awk/comments/4omosp/differences_bet...
[3] https://archive.is/btGky https://archive.is/btGky
- bionoid 7y ago[2] is available here: https://www.removeddit.com/r/awk/comments/4omosp/differences_between_gawk_nawk_mawk_and_posix_awk/ https://www.removeddit.com/r/awk/comments/4omosp/differences... Archive for posterity: http://archive.is/btGky http://archive.is/btGky
- mehrdadn 7y ago> do you have an example? Sure, try this: echo 1 2 | awk '{ print gensub(/1/, "3", "g", $1); }' The logical thing for them to do would be to mention in bold and/or big and/or red font under gensub's documentation that it's an extension (e.g. try nawk), whereas looking through it I don't see any mention at all: https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html#String-Functions https://www.gnu.org/software/gawk/manual/html_node/String-Fu... If I may rant about this for a bit, GNU software manuals are generally rather awful (though they're neither alone in this nor is it impossible to find exceptions). They frequently make absolutely zero effort to display important information more prominently and unimportant information less so (if you're even lucky enough that they tell you the important information in the first place). Like if passing --food will accidentally blow up a nuke in your hometown, you can expect that if they documented it at all, they just casually buried it in the middle of some random paragraph. Their operating assumption seems to be that if you can't be bothered to spend the next 4 hours reading a novel before writing your one-liner then it's just obviously your fault for sucking so much.
- Liquid_Fire 7y agoWhile I agree it should be more obvious, it does say in the opening section: > Those functions that are specific to gawk are marked with a pound sign (‘#’). They are not available in compatibility mode (see section Command-Line Options)
- mehrdadn 7y agoOh dear lord. I've looked at that page probably twenty times in the past year and still not seen the note about that pound sign. Thanks for pointing it out. Man it's infuriating.