{"id":11251,"date":"2023-03-30T13:14:43","date_gmt":"2023-03-30T17:14:43","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=11251"},"modified":"2023-03-30T13:14:43","modified_gmt":"2023-03-30T17:14:43","slug":"some-technical-details-on-awk","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=11251","title":{"rendered":"Some Technical Details on AWK"},"content":{"rendered":"<p>Many of you know that I\u2019m a big fan of AWK. After Lisp and C, it\u2019s my go to language, especially for scripts that involve reading a bunch of lines and performing some sort of regex-mediated action on them. Its language is basically C-like but there are some anomalies that can seem mysterious.<\/p>\n<p>Volodymyr Gubarkov has a project to provide an InteliJ plug in for AWK and part of that requires parsing AWK syntax so he has a good handle on those anomalies and why they exist. He discusses those peculiarities in his post, <a href=\"https:\/\/maximullaris.com\/awk_tech_notes.html\">AWK technical notes<\/a>.<\/p>\n<p>It\u2019s an interesting post that explains many things that you probably didn\u2019t know about AWK. In a way, it\u2019s getting into the weeds but it also increases your understanding of the way things work and allows you to write better AWK.<\/p>\n<p>For example, one thing I didn\u2019t know was that although it\u2019s illegal to have a space between a <i>user defined<\/i> function and its argument list, it <i>is<\/i> legal to have a space between a <i>built in<\/i> function and its argument list. The reason for that involves string concatenation. Take a look at Gubarkov\u2019s post for the details.<\/p>\n<p>The post mentions some other interesting anomalies in the AWK syntax and the reasons for them. If you use AWK, it\u2019s definitely worth reading the post if only to be aware of the gotchas waiting for the unwary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many of you know that I\u2019m a big fan of AWK. After Lisp and C, it\u2019s my go to language, especially for scripts that involve reading a bunch of lines and performing some sort of regex-mediated action on them. Its &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=11251\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[37],"class_list":["post-11251","post","type-post","status-publish","format-standard","hentry","category-general","tag-tech"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11251"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11251\/revisions"}],"predecessor-version":[{"id":11252,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11251\/revisions\/11252"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}