The AWK Programming Language, 2nd Ed

Author: Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger
Publisher: Addison-Wesley
Pages: 240
ISBN: 978-0138269722
Print: 0138269726
Kindle: B0CCJ1N4X3
Audience: Developers interested in Awk
Rating: 5
Reviewer: Kay Ewbank

The name Brian Kernighan among the authors of this updated classic raises expectations as to the book's content, and it doesn't disappoint.

If anybody is in a position to write a definitive guide to Awk, it's Brian Kernighan, as he's one of the co-authors of the Unix tool - his surname supplied the K in the name. He's also been a major maintainer of the language until recently, finally handing over maintenance having worked on the most recent major update of Awk to add support for UTF-8 encoded text and CSV files.

Banner

To reflect the changes, he and his co-authors have updated this classic book that was last released in 1988. The new edition has been reorganized and covers the new features, with added material on data handling and exploration.

Awk is still popular partially because it's easy to learn, and is always available on UNIX, Linux, MacOS and usually on Windows. Kernighan describes it as a language that lets you write something in a short program, often in a single line of code, because Awk handles the 'baggage' that you need in other languages.

 

The book opens with an Awk tutorial that introduces the main commands and examples showing how Awk is used. This is further explored in the next chapter, Awk in action, which looks at selections, transformations, summarizations, and setting up a database.

A chapter on exploratory data analysis uses accessible examples including an analysis of passenger mortality data from the sinking of the Titanic; and working with a large dataset in the form of the beer ratings from RateBeer.

Data processing is covered next, with sections on data transformation and reduction, validation, and handling multiline records. A chapter on reports and databases then goes on and covers the use of packaged queries and reports.

A chapter on processing words looks at using Awk for the manipulation of natural language text; not an obvious use, but the examples include programs that generate words and phrases, carry on limited dialogs with users, and so on. The authors acknowledge that the examples are toys, but point out that some of the document preparation programs are in regular use.

Chapter 7 is titled 'Little Languages', and looks at the use of Awk to develop translators for languages for specific applications such as an assembler, interpreter, and calculators. The examples include a sort generator, reverse-polish calculator, and recursive-descent parsers for arithmetic expressions and a subset of Awk.

A chapter on 'experiments with algorithms' comes next with sections on sorting, profiling and topological sorting. There's also an extended example looking at Make, a file updating program.

The final chapter of the book considers Awk as a language, its history, and its strengths and weaknesses.

Overall, this is a well written, informative and authoritative book. Awk is a useful tool that is widely available, and this book tells you all you need to know.

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Professional Scrum Development with Azure DevOps

Author: Richard Hundhausen
Publisher: Microsoft Press
Pages: 432
ISBN: 978-0136789239
Print: 0136789234
Kindle: B08F5HCNJ7
Audience: Developers interested in Scrum
Rating: 5
Reviewer: Kay Ewbank

This is a book designed for teams using Scrum and Azure DevOps together for developing complex product [ ... ]



DevOps For The Desperate

Author: Bradley Smith
Publisher: No Starch
Pages: 176
ISBN: 978-1718502482
Print: 1718502486
Kindle: B09M82VY43
Audience: Developers working in DevOps
Rating: 4.5
Reviewer: Kay Ewbank

Subtitled 'A hands-on survival guide, this book aims to provide software engineers and developers with the basi [ ... ]


More Reviews