More shell, less egg (2011)
leancrew.com
leancrew.com
cf. "Programming Pearls: A literate program" https://dl.acm.org/doi/10.1145/5948.315654
Aside: I received a masterclass from Gradmaster McIlroy, in context of this selfsame shell pipeline: https://www.evalapply.org/posts/shell-aint-a-bad-place-to-fp...
I was floating in the air all week :D
(edit: typo)
The 3rd edition can be read online here: https://www.pbr-book.org/
That said https://www.amazon.com/Exercises-Programming-Style-Cristina-... is a good sized book that is nothing but takes on this program from different styles. It is amusing how far you can take that.
Which... is kind of the point of the Knuth solution here. It was a pedagogical exercise. As much to show how literate programs can be presented as it was to "solve" the stated problem.
Edit: It occurs to me you could be referring to the pipeline version. Which, yeah, I don't think that really changes my post. :D. The final paragraph would be changed to the point of the Milroy's code is to get the answer, not to have a library function that is expected to be used again and again on input.
However if you want to extend the program from a toy to something that can handle words like "won't" "c-code" "a.i." or "naïve" then it will be quite difficult to do so.
But it's a "nonce": to be used once, on a small desktop machine (for low-integer values of once). That's not really a good objection.