Previous: Bugs, Up: Installation


B.6 Other Freely Available awk Implementations

It's kind of fun to put comments like this in your awk code.
// Do C++ comments work? answer: yes! of course
Michael Brennan

There are a number of other freely available awk implementations. This section briefly describes where to get them:

Unix awk
Brian Kernighan has made his implementation of awk freely available. You can retrieve this version via the World Wide Web from his home page.1 It is available in several archive formats:
Shell archive
http://cm.bell-labs.com/who/bwk/awk.shar
Compressed tar file
http://cm.bell-labs.com/who/bwk/awk.tar.gz
Zip file
http://cm.bell-labs.com/who/bwk/awk.zip

This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely.

See BTL, for a list of extensions in this awk that are not in POSIX awk.


mawk
Michael Brennan has written an independent implementation of awk, called mawk. It is available under the GPL (see Copying), just as gawk is.

You can get it via anonymous ftp to the host ftp.whidbey.net. Change directory to /pub/brennan. Use “binary” or “image” mode, and retrieve mawk1.3.3.tar.gz (or the latest version that is there).

gunzip may be used to decompress this file. Installation is similar to gawk's (see Unix Installation).

mawk has the following extensions that are not in POSIX awk:

The next version of mawk will support nextfile.


awka
Written by Andrew Sumner, awka translates awk programs into C, compiles them, and links them with a library of functions that provides the core awk functionality. It also has a number of extensions.

The awk translator is released under the GPL, and the library is under the LGPL.

To get awka, go to http://awka.sourceforge.net. You can reach Andrew Sumner at andrew@zbcom.net.


pawk
Nelson H.F. Beebe at the University of Utah has modified the Bell Labs awk to provide timing and profiling information. It is different from pgawk (see Profiling), in that it uses CPU-based profiling, not line-count profiling. You may find it at either ftp://ftp.math.utah.edu/pub/pawk/pawk-20020210.tar.gz or http://www.math.utah.edu/pub/pawk/pawk-20020210.tar.gz.


The OpenSolaris POSIX awk
The version of awk in /usr/xpg4/bin on Solaris is POSIX compliant. It is based on the awk from Mortice Kern Systems for PCs. The source code can be downloaded from the OpenSolaris web site.2 This author was able to make it compile and work under GNU/Linux with 1–2 hours of work. Making it more generally portable (using GNU Autoconf and/or Automake) would take more work, and this has not been done, at least to our knowledge.


jawk
This is an interpreter for awk written in Java. It claims to be a full interpreter, although because it uses Java facilities for I/O and for regexp matching, the language it supports is different from POSIX awk. More information is available on the project's home page.3.

Footnotes

[1] http://cm.bell-labs.com/who/bwk

[2] http://www.opensolaris.org

[3] http://jawk.sourceforge.net