Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
AWK
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Versions and implementations == AWK was originally written in 1977 and distributed with [[Version 7 Unix]]. In 1985 its authors started expanding the language, most significantly by adding user-defined functions. The language is described in the book ''[[The AWK Programming Language]]'', published 1988, and its implementation was made available in releases of [[UNIX System V]]. To avoid confusion with the incompatible older version, this version was sometimes called "new awk" or ''nawk''. This implementation was released under a [[free software license]] in 1996 and is still maintained by Brian Kernighan (see external links below).{{citation needed|date=February 2020}} Old versions of Unix, such as [[UNIX/32V]], included <code>awkcc</code>, which converted AWK to C. Kernighan wrote a program to turn awk into {{nowrap|C++}}; its state is not known.<ref>{{cite conference |first=Brian W. |last=Kernighan |date=April 24β25, 1991 |url=https://www.cs.princeton.edu/~bwk/btl.mirror/awkc++.pdf |title=An AWK to C++ Translator |event=Usenix C++ Conference |location=Washington, DC |pages=217β228 |conference= |access-date=2020-02-01 |archive-date=2020-06-22 |archive-url=https://web.archive.org/web/20200622061725/https://www.cs.princeton.edu/~bwk/btl.mirror/awkc++.pdf |url-status=live }}</ref> * '''BWK awk''', also known as '''nawk''', refers to the version by [[Brian Kernighan]]. It has been dubbed the "One True AWK" because of the use of the term in association with the book that originally described the language and the fact that Kernighan was one of the original authors of AWK.<ref name = "AWK1">{{cite book | title= The AWK Programming Language |first1=Alfred V. |last1=Aho |first2=Brian W. |last2=Kernighan |first3=Peter J. |last3=Weinberger | year= 1988 | publisher= Addison-Wesley Publishing Company | isbn= 9780201079814 |url = https://archive.org/details/pdfy-MgN0H1joIoDVoIC7 | access-date = 16 May 2015 }}</ref> FreeBSD refers to this version as ''one-true-awk''.<ref>{{cite web |url=http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/one-true-awk/FREEBSD-upgrade?rev=1.9&content-type=text/x-cvsweb-markup |archive-url=https://web.archive.org/web/20130908180035/http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/one-true-awk/FREEBSD-upgrade?rev=1.9&content-type=text%2Fx-cvsweb-markup |archive-date=September 8, 2013 |title=FreeBSD's work log for importing BWK awk into FreeBSD's core |date=May 16, 2005 |access-date=September 20, 2006 |url-status=live }}</ref> This version also has features not in the book, such as <code>tolower</code> and <code>ENVIRON</code> that are explained above; see the FIXES file in the source archive for details. This version is used by, for example, [[Android (operating system)|Android]], [[FreeBSD]], [[NetBSD]], [[OpenBSD]], [[macOS]], and [[illumos]]. Brian Kernighan and Arnold Robbins are the main contributors to a source repository for ''nawk'': {{URL|https://github.com/onetrueawk/awk}}. * '''gawk''' ([[GNU]] awk) is another free-software implementation and the only implementation that makes serious progress implementing [[internationalization and localization]] and TCP/IP networking. It was written before the original implementation became freely available. It includes its own debugger, and its [[profiling (computer programming)|profiler]] enables the user to make measured performance enhancements to a script. It also enables the user to extend functionality with shared libraries. Some [[Linux distribution]]s include ''gawk'' as their default AWK implementation.{{Citation needed|date=September 2018}} As of version 5.2 (September 2022) ''gawk'' includes a persistent memory feature that can remember script-defined variables and functions from one invocation of a script to the next and pass data between unrelated scripts, as described in the Persistent-Memory ''gawk'' User Manual: {{URL|https://www.gnu.org/software/gawk/manual/pm-gawk/}}. ** '''gawk-csv'''. The [[Comma-separated values|CSV]] extension of ''gawk'' provides facilities for inputting and outputting CSV formatted data.<ref>{{cite web | title=CSV Processing With gawk (using the gawk-csv extension)| website=gawkextlib |year=2018 | url=https://gawkextlib.sourceforge.net/csv/gawk-csv.htmlurl-statuse=live|archive-url=https://web.archive.org/web/20200325201153/http://gawkextlib.sourceforge.net/csv/gawk-csv.html |archive-date=2020-03-25}}</ref> * '''mawk''' is a very fast AWK implementation by Mike Brennan based on a [[bytecode]] interpreter. * '''libmawk''' is a fork of mawk, allowing applications to embed multiple parallel instances of awk interpreters. * '''awka''' (whose front end is written atop the ''mawk'' program) is another translator of AWK scripts into C code. When compiled, statically including the author's libawka.a, the resulting executables are considerably sped up and, according to the author's tests, compare very well with other versions of AWK, [[Perl]], or [[Tcl]]. Small scripts will turn into programs of 160β170 kB. * '''tawk''' (Thompson AWK) is an AWK [[compiler]] for [[Solaris (operating system)|Solaris]], [[DOS]], [[OS/2]], and [[Microsoft Windows|Windows]], previously sold by Thompson Automation Software (which has ceased its activities).<ref>{{cite news |url=https://www.drdobbs.com/tools/examining-the-tawk-compiler/184410193 |work=[[Dr. Dobb's Journal]] |author=James K. Lawless |date=May 1, 1997 |title=Examining the TAWK Compiler |access-date=February 21, 2020 |archive-date=February 21, 2020 |archive-url=https://web.archive.org/web/20200221191605/https://www.drdobbs.com/tools/examining-the-tawk-compiler/184410193 |url-status=live }}</ref> * '''Jawk''' is a project to implement AWK in [[Java (programming language)|Java]], hosted on SourceForge.<ref>{{Cite web |url=http://sourceforge.net/projects/jawk/ |title=''Jawk'' at SourceForge |access-date=2006-08-23 |archive-date=2007-05-27 |archive-url=https://web.archive.org/web/20070527021808/http://sourceforge.net/projects/jawk |url-status=live }}</ref> Extensions to the language are added to provide access to Java features within AWK scripts (i.e., Java threads, sockets, collections, etc.). * '''xgawk''' is a fork of ''gawk''<ref>{{Cite web |url=http://gawkextlib.sourceforge.net/ |title=''xgawk'' Home Page |access-date=2013-05-07 |archive-date=2013-04-18 |archive-url=https://web.archive.org/web/20130418224130/http://gawkextlib.sourceforge.net/ |url-status=live }}</ref> that extends ''gawk'' with dynamically loadable libraries. The XMLgawk extension was integrated into the official GNU Awk release 4.1.0. * '''QSEAWK''' is an embedded AWK interpreter implementation included in the QSE library that provides embedding [[application programming interface]] (API) for [[C (programming language)|C]] and [[C++]].<ref>{{Cite web |url=https://github.com/hyung-hwan/qse |title=QSEAWK at GitHub |website=[[GitHub]] |access-date=2017-09-06 |archive-date=2018-06-11 |archive-url=https://web.archive.org/web/20180611001042/https://github.com/hyung-hwan/qse |url-status=live }}</ref> * '''libfawk''' is a very small, function-only, reentrant, embeddable interpreter written in C * '''[[BusyBox]]''' includes an AWK implementation written by Dmitry Zakharov. This is a very small implementation suitable for embedded systems. * '''CLAWK''' by Michael Parker provides an AWK implementation in [[Common Lisp]], based upon the regular expression library of the same author.<ref>{{Cite web |url=https://github.com/sharplispers/clawk |title=CLAWK at GitHub |website=[[GitHub]] |access-date=2021-06-01 |archive-date=2021-08-25 |archive-url=https://web.archive.org/web/20210825102602/https://github.com/sharplispers/clawk |url-status=live }}</ref> * '''goawk''' is an AWK implementation in Go with a few convenience extensions by Ben Hoyt, hosted on [https://github.com/benhoyt/goawk Github]. The gawk manual has a list of more AWK implementations.<ref>{{cite book |chapter-url=https://www.gnu.org/software/gawk/manual/html_node/Other-Versions.html |title=GAWK: Effective AWK Programming: A User's Guide for GNU Awk |chapter=B.5 Other Freely Available awk Implementations|date=September 2024|edition=5.3|access-date=2025-01-24}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)