HACKER Q&A
📣 AstroJetson

What is the most amazing Awk program you've used


I've been an AWK user since Unix Version 7, its been my Swiss Army Knife for decades (at times becoming a Swiss Army Hammer) I've used it to build a computer billing system. I worked at a company that gobbled smaller companies during the M&A boom times, AWK saved me merging cruft data into our master systems. I've even run an AWK webserver to do quick shares of data.

The recent post of a AWK program that is a GIT CLI tool moved it into the most amazing AWK program for me.

I know that Henry Spencer build a text processor and an assembler in AWK (30K lines).

What is the most amazing AWK program you've heard about / used?


  👤 ColinWright Accepted Answer ✓
I don't know about amazing, but an AWK program builds my website. Don't blame the programming language for the crappy HTML, that's completely my fault. I learned HTML1 and never really progressed, except in dribs-and-drabs.

Still, the code runs and does a pretty good job of executing the algorithm I gave it.

But I wouldn't call it amazing. Most of my AWK is small, few-liners.

I do have a story about learning the power of associative arrays, but that should be a separate post.


👤 asicsp
Pseudo-3D shooter written completely in gawk using raycasting technique: https://github.com/TheMozg/awk-raycaster

See also this list of projects: https://github.com/freznicek/awesome-awk?tab=readme-ov-file#...


👤 ksherlock
Speaking of AWK and Henry Spencer, let me quote from the awf readme:

This is awf, the Amazingly Workable Formatter -- a "nroff -man" or (subset) "nroff -ms" clone written entirely in (old) awk.

It is slow and has many restrictions, but does a decent job on most manual pages and simple -ms documents, and isn't subject to AT&T's brain-damaged licensing that denies many System V users any text formatter at all. It is also a text formatter that is simple enough to be tinkered with, for people who want to experiment.

Type "make r" to run a regression test, formatting the manual page (awf.1) and comparing it to a preformatted copy (awf.1.out). Type "make install" to install it. Pathnames may need changing.

I don't know whether awf will run on 16-bit machines. Data requirements are modest, but I fear the programs are probably big enough to run awk out of space.

I can't believe I really wrote this.

Henry Spencer at U of Toronto Zoology

henry@zoo.toronto.edu utzoo!henry

13 July 1990

---

(n.b. the first release of groff was June 1990)


👤 vocatan
Somebody posted a git client written in awk here on hacker news today.