In Memoriam Linuxlots (http://www.linuxlots.com/~dunne), 1999 -- 2011, R.I.P.

You are here: http://dunne.freeshell.org//awk.html

Go to: index | blog | contact


awk

I suppose awk is a part of history now, and commonly regarded as nothing more than one of the inspirations for perl. However, it is still a very usable tool.

It started off as AWK, after Aho, Weinberger and Kernighan, its inventors; but is now usually written awk, after the Unix command.

Awk is much misunderstood. Thanks to its origins, it tends to be thought of a little tool for doing simple text manipulation; but in fact it is a complete programming language.

The BEGIN/loop/END structure is rather like the "program cycle" in IBM's RPG language. It is there for your convenience in certain circumstances — you don't have to use it.

The main omission is the lack of any network functionality. But then this is unix — Awk can call any of the myriads of programs in the unix toolkit to rectify this and other deficiencies. So, you want networking in your scripts? Use netcat (alias nc(1)).

Many modern languages suffer badly from bloat. Awk is not bloated, anything but: it is small and simple. I dare saw most would say, "too simple!". But there is a lot to be said for the small size of the language. Alas, "Keep It Simple, Stupid" is a rule honoured more often in the breach than in the observance.

Again, many modern languages are changed far more than circumstances really require. Awk does not change (although Gawk still does). This is A Good Thing.

Awk Resources


Viewable with any browser

This page was brought to you by ksh, vi, m4, sed & make, courtesy of openbsd.
Last changed: Sun Mar 3 11:54:01 CET 2019