1 / 21

AWK

UNI Kassel VERSITÄT. AWK. Fatemeh Mohsenipour. Contents. What is AWK? AWK Versions Typical applications of AWK AWK features AWK Advantages AWK Disadvantages Structure of an AWK Program Song exampel Inroduce creaters of AWK Interview summery References. What is AWK?.

milos
Download Presentation

AWK

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UNIKassel VERSITÄT AWK Fatemeh Mohsenipour

  2. Contents • What is AWK? • AWK Versions • Typical applications of AWK • AWK features • AWK Advantages • AWK Disadvantages • Structure of an AWK Program • Song exampel • Inroduce creaters of AWK • Interview summery • References

  3. What is AWK? • Is a script language • Originally designed/implemented in 1977 in Bell laboratory • A Pattern scanning and processing language • The language looks a little like C

  4. AWK Versions • oawk first version ab 1977 (old AWK) • nawk – extended version from 1985 (new AWK) • mawk – extended version by Michael Brennan • gawk – GNU-AWK (faster, better Error messages)

  5. AWK features • Interpreter • Stream-oriented editor • As a filter program used in pipelines • Automatic memory management • No variable declaration • Few data type • Automatic data type conversion between number and string • Allows fast, interactive development

  6. Typical applications of AWK • Generate reports • Reformatting texts • Creating small databases. • Validate data • Look for entries with certain properties

  7. AWK Advantages • Is eay to learn • Let to experiment with algorithms • Can be used for rapid prototyping • Is small and available every where • It is interpreted language

  8. AWK Disadvantages • Not sutible to writing big programs • Relatively slow for large amounts of data • No variables declaration • Sequential file access • Syntax error messages rather Spartan

  9. Structure of an AWK Program BEGIN pattern {action} pattern {action} . . . pattern { action} END

  10. Program example BEGIN { for(i = 99; i >= 0; i--) { print ubottle(i), "on the wall,", lbottle(i) "." print action(i), lbottle(inext(i)), "on the wall." print } } function ubottle(n) { return sprintf("%s bottle%s of beer", n ? n : "No more", n - 1 ? "s" : "") } function lbottle(n) { return sprintf("%s bottle%s of beer", n ? n : "no more", n - 1 ? "s" : "") } function action(n) { return sprintf("%s", n ? "Take one down and pass it around," : \ "Go to the store and buy some more,") } function inext(n) { return n ? n - 1 : 99 }

  11. Alfred Aho Birth : August 9, 1941 in, Canada Education: Ph.D. in Electrical Engineering/Computer Science from Princeton University Current Position : Professorof Computer Science at Columbia University. Writings: AWK programming language,Compilers: Principles, Techniques, and Tools , Unix tools egrep and fgrep, Aho–Corasick string matching algorithm [1]

  12. Brain Kerningham • Birth : born January 1942 in Toronto • Education: Ph.D. in Electrical Engineering/Computer Science from Princeton University • Current Position : Professor of Computer Science at Princeton University. • Writings: • Software Tools in Pascal • The C Programming Language • The Elements of Programming Style • The Unix Programming Environment • The AWK Programming Language • AMPL: A Modeling Language for [2]

  13. Peter Weinberger • Education: PhD in mathematics from the University of California, Berkeley • Current Position: as computer scientist who works at Google. • Writings:The AWK Programming Language [3]

  14. Interview • Importance of understanding user’s requirement by developer • Attract more users • Better software design • Software survive

  15. Interview • Importance of formalizing the semantics and ideas of language • Tedious • Expensive

  16. Interview • Importance of having tools and enough science for producing software and role of developers taste • Sound principles • Personal taste

  17. Interview • which features should be measured during development of code base? • Correctness • Keeping documentation and comment with code

  18. Interview • Features of good manual for new language • Let find things easy • Crystal clear examples

  19. Interview • How choice of programming effect security • Logical errors • Buffer overflow

  20. refrences 1- Masterminds of Programming, O‘Reilly 2009 2- http://www.vectorsite.net/tsawk_2.html#m1 3-http://www.grymoire.com/Unix/Awk.html#uh-0 4-http://www.awktutorial.com/ 5-http://www.computerworld.com.au/article/216844/a- z_programming_languages_awk/?pp=2 [1] http://www.columbia.edu/cu/news/03/05/images/alfredAho.jpg [3] http://www.chessbase.com/images2/2003/weinberger05.jpg [2]http://www.at-mix.de/images/glossar/kernighan-brian.jpg

  21. THANK YOU!

More Related