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!
{{Short description|Text processing programming language}} {{About|the programming language}} {{Infobox programming language | logo = The-AWK-Programming-Language.svg | logo_size = 200px | screenshot = Awk-example-usage-gimp.gif | screenshot_size = 250px | screenshot caption = Usage of AWK in shell to check matching fields in two files | name = AWK | paradigm = [[scripting language|Scripting]], [[procedural programming|procedural]], [[data-driven programming|data-driven]]<ref name=developerworks>{{cite web|url=https://www6.software.ibm.com/developerworks/education/au-gawk/au-gawk-a4.pdf|title=Get started with GAWK: AWK language fundamentals|last=Stutz|first=Michael|date=September 19, 2006|work=developerWorks|publisher=[[IBM]]|access-date=2015-01-29|quote=[AWK is] often called a data-driven language -- the program statements describe the input data to match and process rather than a sequence of program steps|archive-date=2015-04-27|archive-url=https://web.archive.org/web/20150427143548/https://www6.software.ibm.com/developerworks/education/au-gawk/au-gawk-a4.pdf|url-status=live}}</ref> | year = {{start date and age|1977}} | latest_release_version = [http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html IEEE Std 1003.1-2008] (POSIX) / 1985 | designer = [[Alfred Aho]], [[Peter J. Weinberger|Peter Weinberger]], and [[Brian Kernighan]] | typing = none; can handle strings, integers and floating-point numbers; regular expressions | implementations = awk, GNU Awk, mawk, nawk, MKS AWK, Thompson AWK (compiler), Awka (compiler) | dialects = ''old awk'' oawk 1977, ''new awk'' nawk 1985, ''GNU Awk'' gawk | influenced_by = [[C (programming language)|C]], [[sed]], [[SNOBOL]]<ref>{{cite book |title=UNIX Workshop |publisher=Macmillan International Higher Education |author=Andreas J. Pilavakis |year=1989 |pages=196 }}</ref><ref>{{cite book |title=Effective Awk Programming: Universal Text Processing and Pattern Matching |edition=4th |publisher=O'Reilly Media |author=Arnold Robbins |year=2015 |pages=560}}</ref> | influenced = [[Tcl]], [[AMPL]], [[Perl]]<!--1987-->, [[Korn Shell]] (''ksh93''<!--1993-->, ''dtksh'', ''tksh''), [[Lua]]<!--1993--> | operating_system = [[Cross-platform]] | website = }} '''AWK''' ({{IPAc-en|ΙΛ|k}}<ref name=awkLC.DR/>) is a [[domain-specific language]] designed for text processing and typically used as a [[data extraction]] and reporting tool. Like [[sed]] and [[grep]], it is a [[filter (software)|filter]],<ref name=awkLC.DR>{{cite magazine |magazine=Digital Review |date=May 2, 1988 |page=91 |author=James W. Livingston |title=The Great awk Program is No Birdbrain}}</ref> and it is a standard feature of most [[Unix-like|Unix-like operating systems]]. The AWK language is a [[data-driven programming|data-driven]] [[scripting language]] consisting of a set of actions to be taken against [[Stream (computing)|streams]] of textual data β either run directly on files or used as part of a [[pipeline (Unix)|pipeline]] β for purposes of extracting or transforming text, such as producing formatted reports. The language extensively uses the [[string (computer science)|string]] [[datatype]], [[associative array]]s (that is, arrays indexed by key strings), and [[regular expression]]s. While AWK has a limited intended [[Domain (software engineering)|application domain]] and was especially designed to support [[one-liner program]]s, the language is [[Turing-complete]], and even the early Bell Labs users of AWK often wrote well-structured large AWK programs.<ref>{{cite web | url = http://www.faqs.org/docs/artu/ch08s02.html#awk | title = Applying Minilanguages | first = Eric S. | last = Raymond | author-link = Eric S. Raymond | work = The Art of Unix Programming | at = Case Study: awk | archive-url = https://web.archive.org/web/20080730063308/http://www.faqs.org/docs/artu/ch08s02.html#awk | archive-date = July 30, 2008 | access-date = May 11, 2010 | quote = The awk action language is Turing-complete, and can read and write files. }}</ref> AWK was created at [[Bell Labs]] in the 1970s,<ref>{{cite tech report |url=https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.1299 |title=Awk β A Pattern Scanning and Processing Language (Second Edition) |last1=Aho |first1=Alfred V. |author-link1=Alfred Aho |last2=Kernighan |first2=Brian W. |author-link2=Brian Kernighan |last3=Weinberger |first3=Peter J. |author-link3=Peter J. Weinberger |date=September 1, 1978 |publisher=Bell Telephone Laboratories, Inc. |series=Unix Seventh Edition Manual, Volume 2 |access-date=February 1, 2020}}</ref> and its name is derived from the surnames of its authors: [[Alfred Aho]] (author of [[egrep]]), [[Peter J. Weinberger|Peter Weinberger]] (who worked on tiny relational databases), and [[Brian Kernighan]]. The acronym is pronounced the same as the name of the bird species [[auk]], which is illustrated on the cover of ''[[The AWK Programming Language]]''.<ref name="AWK1" /> When written in all lowercase letters, as <code>awk</code>, it refers to the [[Unix]] or [[Plan 9 from Bell Labs|Plan 9]] program that runs scripts written in the AWK programming language.
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)