{"id":10757,"date":"2022-08-22T12:59:49","date_gmt":"2022-08-22T16:59:49","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=10757"},"modified":"2022-08-22T12:59:49","modified_gmt":"2022-08-22T16:59:49","slug":"more-on-the-brailsford-kernighan-video","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=10757","title":{"rendered":"More On the Brailsford-Kernighan Video"},"content":{"rendered":"<p>The <a href=\"https:\/\/irreal.org\/blog\/?p=10746\">video chat between David Brailsford and Brian Kernighan<\/a> has sparked a lot of interest and commentary among the Unix faithful. Dough McIlroy offered <a href=\"https:\/\/minnie.tuhs.org\/pipermail\/tuhs\/2022-August\/026336.html\">this story<\/a> concerning <code>egrep<\/code> to the conversation. The <code>egrep<\/code> connection is that it was <code>egrep<\/code>\u2019s regex technology that powered AWK.<\/p>\n<p>McIlroy explains that for years he thought he was responsible for getting Ken Thompson to cut the regex code from <code>ed<\/code> and turn it into <code>grep<\/code>. He learned much later\u2014through the THUS mailing list\u2014that, in fact, Thompson had already done that to make a tool for his own use and all that really happened was that McIlroy\u2019s urging got him to make it publicly available.<\/p>\n<p>McIlroy goes on to say that he used <code>egrep<\/code> as an integral part of his <code>calendar<\/code> program but that it painfully slow. Al Aho, the developer of <code>egrep<\/code> was mortified and introduced lazy state building to <code>egrep<\/code> to make it faster. That worked but now McIlroy wonders whether he really inspired Aho to make the change or whether it was something he had already planned.<\/p>\n<p>A bit later Mohamed Akram sent a <a href=\"https:\/\/minnie.tuhs.org\/pipermail\/tuhs\/2022-August\/026339.html\">message<\/a> saying that he had written a <a href=\"https:\/\/akr.am\/blog\/posts\/today-in-history-brought-to-you-by-unix\">blog post<\/a> about <code>calendar<\/code> that explains what it does and how it does it. The TL;DR is that it\u2019s a simple script that calls a C program to build a regex and then uses that regex in an <code>egrep<\/code> call to extract the desired information from the calendar file. Read Akram\u2019s post for the details and the code.<\/p>\n<p>McIlroy is a master at this sort of thing and <code>calendar<\/code> is a nice example of the way he leveraged existing tools tied together with a shell script to get things done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The video chat between David Brailsford and Brian Kernighan has sparked a lot of interest and commentary among the Unix faithful. Dough McIlroy offered this story concerning egrep to the conversation. The egrep connection is that it was egrep\u2019s regex &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=10757\">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,36],"class_list":["post-10757","post","type-post","status-publish","format-standard","hentry","category-general","tag-tech","tag-unix"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10757","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=10757"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10757\/revisions"}],"predecessor-version":[{"id":10758,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10757\/revisions\/10758"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}