AWK: Difference between revisions
Appearance
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
AWK is a pattern matching programming language primarily used in [[UNIX]] like systems for software pre-processing and other text handling tasks. It is named after initials of original writers Alfred Aho, Peter Weinberger, and Brian Kernighan and should therefore be spelled all caps. | AWK is a pattern matching programming language primarily used in [[UNIX]] like systems for software pre-processing and other text handling tasks. It is named after initials of original writers Alfred Aho, Peter Weinberger, and Brian Kernighan and should therefore be spelled all caps. | ||
== | ==History== | ||
=== | *1977: old awk (awk) | ||
* [[GNU awk]] - Open source | *new awk (nawk) | ||
*POSIX awk | |||
==Constructs== | |||
;Comparison Expressions | |||
:Relational Operators: | |||
< <= == != >= > ~ !~ | |||
:Conditional Expressions | |||
:Computation | |||
+ - * / % ^ | |||
:Compound Patterns | |||
&& || ! | |||
:Range Patterns | |||
;Variables | |||
;Conditional Statements | |||
:if | |||
:if/else | |||
;Loops | |||
:while | |||
:for | |||
;Program Control | |||
:next | |||
:exit | |||
;Arrays | |||
==Built-In Functions== | |||
String | |||
* sub, gsub | |||
* index | |||
* length | |||
* substr | |||
* match | |||
* split | |||
Arithmetic | |||
* atan2 | |||
* cos | |||
* exp | |||
* int | |||
* log | |||
* rand | |||
* sin | |||
* sqrt | |||
* srand | |||
==OS/2 Implementations== | |||
;Compiler | |||
* [[Preditor/2]] - Has a built in extended AWK compiler | |||
* [[TAWK]] Compiler for OS/2 from ''Thompson Automation Software'' | |||
;Interpreter | |||
* [[GNU awk]] - Open source | |||
* QTAwk 1.22 (1997-01-07) - Shareware | * QTAwk 1.22 (1997-01-07) - Shareware | ||
* mawk - Michael Brennan - Open Source (GPL) | * mawk - Michael Brennan - Open Source (GPL) | ||
* SAWK - Sandeep Dutta | |||
* | |||
;Translators | |||
* | *a2p - AWK to PERL translator - Open source (included with [[Perl]] 5) | ||
;Editor support | |||
* [[Elvis]] - awk syntax support included by default | * [[Elvis]] - awk syntax support included by default | ||
* [[Lugaru Epsilon]] - AWK syntax highlighting, code folding and syntax-aware autoindent available as a separate download. | |||
* [[Lugaru Epsilon]] - AWK syntax highlighting, code folding and syntax-aware autoindent available as a | |||
* [[NEdit]] - XFree86 - Autoindent, autocomplete and syntax highlighting. | * [[NEdit]] - XFree86 - Autoindent, autocomplete and syntax highlighting. | ||
* [[Preditor/2]] - AWK template, syntax highlighting and debugging features | * [[Preditor/2]] - AWK template, syntax highlighting and debugging features. | ||
;Programmer's utilities | |||
* [[Exuberant ctags]] - Creates index files out of AWK source files - Open source - Current. | * [[Exuberant ctags]] - Creates index files out of AWK source files - Open source - Current. | ||
==DOS | ==DOS Implementations== | ||
* Bawk - Bob Brodt | * Bawk - Bob Brodt | ||
* | * Gawk | ||
* QTAwk - Pearl Boldt | * QTAwk - Pearl Boldt | ||
;Editor support | |||
* [[Elvis]] - awk syntax support included by default | * [[Elvis]] - awk syntax support included by default | ||
* [[Lugaru Epsilon]] - AWK syntax highlighting, code folding and syntax-aware | * [[Lugaru Epsilon]] - AWK syntax highlighting, code folding and syntax-aware auto-indent available as a separate download. | ||
==Java Implementations== | |||
* Jawk - J2SE 5 | |||
;Editor support | |||
* [[jEdit]] - Java based editor - AWK syntax highlighting built in | |||
==Publications== | ==Publications== | ||
* Leon S. Levy: ''A Walk Through AWK'', SIGPLAN Notices Vol. 18 #12 Dec 1983, pp.69-85 | |||
* Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger: ''The AWK Programming Language'' Addison-Wesley 1988, ISBN 0-201-07981-X | * Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger: ''The AWK Programming Language'' Addison-Wesley 1988, ISBN 0-201-07981-X | ||
* Dale Dougherty, Arnold Robbins: ''sed & awk'' O’Reilly 1997, ISBN 1-56592-225-5 | * Dale Dougherty, Arnold Robbins: ''sed & awk'' O’Reilly 1997, ISBN 1-56592-225-5 | ||
Line 40: | Line 95: | ||
* [http://www.computerworld.com.au/article/216844/a-z_programming_languages_awk/ The A-Z of Programming Languages: AWK] - An interview with Alfred V. Aho - From [[Computerworld]] | * [http://www.computerworld.com.au/article/216844/a-z_programming_languages_awk/ The A-Z of Programming Languages: AWK] - An interview with Alfred V. Aho - From [[Computerworld]] | ||
[[Category:Scripting Language]][[Category:AWK]] | |||
[[Category: |
Latest revision as of 22:47, 10 April 2023
AWK is a pattern matching programming language primarily used in UNIX like systems for software pre-processing and other text handling tasks. It is named after initials of original writers Alfred Aho, Peter Weinberger, and Brian Kernighan and should therefore be spelled all caps.
History
- 1977: old awk (awk)
- new awk (nawk)
- POSIX awk
Constructs
- Comparison Expressions
- Relational Operators:
< <= == != >= > ~ !~
- Conditional Expressions
- Computation
+ - * / % ^
- Compound Patterns
&& || !
- Range Patterns
- Variables
- Conditional Statements
- if
- if/else
- Loops
- while
- for
- Program Control
- next
- exit
- Arrays
Built-In Functions
String
- sub, gsub
- index
- length
- substr
- match
- split
Arithmetic
- atan2
- cos
- exp
- int
- log
- rand
- sin
- sqrt
- srand
OS/2 Implementations
- Compiler
- Preditor/2 - Has a built in extended AWK compiler
- TAWK Compiler for OS/2 from Thompson Automation Software
- Interpreter
- GNU awk - Open source
- QTAwk 1.22 (1997-01-07) - Shareware
- mawk - Michael Brennan - Open Source (GPL)
- SAWK - Sandeep Dutta
- Translators
- a2p - AWK to PERL translator - Open source (included with Perl 5)
- Editor support
- Elvis - awk syntax support included by default
- Lugaru Epsilon - AWK syntax highlighting, code folding and syntax-aware autoindent available as a separate download.
- NEdit - XFree86 - Autoindent, autocomplete and syntax highlighting.
- Preditor/2 - AWK template, syntax highlighting and debugging features.
- Programmer's utilities
- Exuberant ctags - Creates index files out of AWK source files - Open source - Current.
DOS Implementations
- Bawk - Bob Brodt
- Gawk
- QTAwk - Pearl Boldt
- Editor support
- Elvis - awk syntax support included by default
- Lugaru Epsilon - AWK syntax highlighting, code folding and syntax-aware auto-indent available as a separate download.
Java Implementations
- Jawk - J2SE 5
- Editor support
- jEdit - Java based editor - AWK syntax highlighting built in
Publications
- Leon S. Levy: A Walk Through AWK, SIGPLAN Notices Vol. 18 #12 Dec 1983, pp.69-85
- Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger: The AWK Programming Language Addison-Wesley 1988, ISBN 0-201-07981-X
- Dale Dougherty, Arnold Robbins: sed & awk O’Reilly 1997, ISBN 1-56592-225-5
- Arnold Robbins: GAWK: Effective AWK Programming O’Reilly 2001, ISBN 0-596-00070-7
Links
- Awk Community Portal
- The A-Z of Programming Languages: AWK - An interview with Alfred V. Aho - From Computerworld