Saturday, July 7, 2012

AWK

Description


               AWK is a pattern scanning and processing language. It is well-suited for small projects involving text processing or formatting, and has some useful features for small database applications. It is a utility that enables a programmer to write tiny but  effective programs in the form of statements that define text patterns to be searched in each line of a document (commonly a text file). Its features for pattern description are derived from those of the grep family of standard Unix tools.

The original description of AWK is given in:
Aho, Alfred V., Brian W. Kernighan, and Peter J. Weinberger. The AWK Programming Language. Addison-Wesley, 1988, ISBN 0-201-07981-X.


Name Origin

                       AWK's name was derived from the initials of its designer: Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan. 

History

               AWK was first written in 1977 by Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan. The name awk is derived from the last initials of the three men. At the time of its creation, all three worked for Bell Labs and awk was released in Version 7 AT&T UNIX and has been a staple in UNIX distributions ever since. There have been only a handful of major modifications to the original awk code. These modifications were done in 1985, 1986, and 1989 when it was renamed to nawk. (New awk) There are many ports of awk to virtually every platform in existence. 


Why learn AWK?

                      It is an excellent filter and report writer. Many UNIX utilities generates rows and columns of information. AWK is an excellent tool for processing these rows and columns, and is easier to use AWK than most conventional programming languages. It can be considered to be a pseudo-C interpreter, as it understands the same arithmetic operators as C. AWK also has string manipulation functions, so it can search for particular strings and modify the output. AWK also has associative arrays, which are incredible useful, and is a feature most computing languages lack. Associative arrays can make a complex problem a trivial exercise.

Sample Code/Execution:

Hello world.


Search and Print.





Sources:
1. http://infohost.nmt.edu/tcc/help/lang/awk.html
2. http://www.staff.science.uu.nl/~oostr102/docs/nawk/nawk_2.html
3. http://searchsoa.techtarget.com/definition/awk 
4. http://www.grymoire.com/Unix/Awk.html
5. http://www.vectorsite.net/tsawk_1.html#m1 

BY:
Ixiapot 2010-43496
Edu-J 2010-42985

No comments:

Post a Comment