Updated Sat Sep 30 14:19:42 EDT 2023
Available in paperback and e-book formats. Order at Amazon and other fine booksellers.
The book will be available by the end of September. In the meantime, we will add material that we hope will be of interest -- historical documents, bits of code, and occasional essays on Awk and related topics.
Contact us at info@awk.dev.
Sept 20, 2023, page 3, line -5:
The input line Kathy 15.50 10 should be in italic. Thanks to Galen Menzel for spotting this error.
Sept 16, 2023, pages 26 and 27:
The streaming version of mc one page 26 prints output in 7 columns, not 5, since the loop starts with n set to zero and ends with n = 6. Here's a better version:
{ out = sprintf("%s%-10.10s ", out, $0) print n if (++n >= 5) { print substr(out, 1, length(out)-2) out = "" n = 0 } }
The second version of mc on page 27 has a different problem: it doesn't include the two spaces between columns when computing the number of columns, so the result is always too high. Probably easiest fixed like this:
ncol = int(60 / (max+2) + 0.5) # int(x) returns integer value of xMany thanks to 郭济琳 (Jilin Guo) for spotting these errors.
A new chapter in the book talks about using Awk for this kind of analysis, using a couple of datasets. But there are plenty of other examples as well. BWK co-taught a course in the Humanities sequence at Princeton where Awk was taught to some very non-technical students as a tool for looking at some neat data about English poetry.
This essay describes some of what went on there; it might give you some ideas about how Awk can be used in a different domain.
There's a Hacker News thread on Ben's original post here, with some interesting comments.
Gawk releases are at https://ftp.gnu.org/gnu/gawk; the Gawk manual is here.
Arnold Robbins has compiled a list of other implementations of Awk.
CSTR 118: An internal technical report on Awk, dated June 1985, so it's not the original language but more or less the one described in the Awk book in 1988.
dformat: Dformat is an Awk program, originally written by Jon Bentley, for drawing data-format diagrams. The version here comes from Arnold Robbins (to whom thanks), who has fixed it up and made it work properly in today's environments.
chem: Chem was an experiment in little languages, a language for describing chemical structure diagrams. (Think benzene rings on steroids.) It wasn't much used but it was a good exercise. The link above is to a somewhat blurry but complete PDF of the original chem paper by Bentley, Lynn Jelinski and bwk, published in Computational Chemistry in 1987.
indexing programs: One of the examples in the original Awk book was a simplified version of indexing tools first created by Jon Bentley, and used both for both editions of the book. The link above provides the code; the paper was published in Electronic Publishing -- Origination Dissemination and Design in 1988. The second edition of the book has somewhat modified code. Thanks to Taj Khattra for finding the EP-ODD source.
Algorithm animation: by Jon Bentley and bwk. The paper A System for Algorithm Animation (1991) describes a system for embedding simple graphics commands in program output that could be used to display an "animated" version of the output. It all worked on monochrome displays, so it's totally dated now, but it was neat at the time. The original Computing Science Technical Report (CSTR) 132 is here.
Netlib's typesetting collection Includes some links to chem and indexing programs
Interview with Al Aho about Awk in Computerworld, May 2008
Interview with Brian Kernighan about Awk and AMPL, Computerworld, October 2009
awk.news (dmr) Tue Jul 15 23:47:57 1986 Rosa Miller, a Tlinget [sic] Indian who lives in Juneau, ... is a member of the Dipper House of the Dog Salmon Clan of the Raven Moiety of the Awk Tribe of the Tlingit (pronounced KLINK-it) Nation.... Mrs. Miller contends that the Awk Tribal Council in Juneau was set up by people who were not Awks but, as she calls them, "Johnny come latelies" to the area.... New York Times, 7/14, p. A8 CORRECTION Because of a transmission error, the Alaska Journal yesterday, from Anchorage, misidentified an Indian tribe. It is the Auk, not Awk. New York Times, 7/15, p. B1
Awk (adj, obs; also awke, auk, awck) [from ON afug, turned the wrong way, back foremost, perverse] 1. Directed the other way or in the wrong direction, back-handed, from the left hand. 1634: "With an awke stroke gaue hym a grete wounde." 2. Untoward, froward, perverse, in nature or disposition. 1642: "Our natures more crooked, inconstante, awk, and perverse." 3. Out of the way, odd, strange (rare) [fortunately] 4. Untoward to deal with, awkward to use, clumsy. There are also awkly, awkness, awkward, awkwardish, awkwardly, awkwardness, and awky.
In Scotland, upon April Day, they have a custom of ``hunting the gowk ...', properly, a cuckoo, and is used here, metaphorically in vulgar language, for a fool. This is done by sending silly people upon fools' errands from place to place, by means of a letter in which it is written: ``On the first day of April, Hunt the gowk another mile.'' John Brand's ``Observations on Popular Antiquities, 1813'' (c) Jeffrey Kacirk
Do you have one to add? Send it along! Mail to info@awk.dev.