Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kevin Taylor.

Similar presentations


Presentation on theme: "Kevin Taylor."— Presentation transcript:

1 Kevin Taylor

2 History of AWK Initially developed in 1977 Created in AT&T Bell Labs
Named after its developers Standard on UNIX/Linux systems Three main branches

3 What is it? Procedural, data-driven scripting language
Syntax similar to bash and Perl Quick video!

4 Versions of AWK AWK ( 1977) New awk, or nawk (1985)
GNU awk, or gawk (1986) Awk++

5 What can AWK do for you Strong text manipulator
Can easily find files/records Can create automated records Good at generating HTML

6 What it can't do Not good at manipulating binary data
Not well suited for parsing HTML Not a web programming language

7 AWK use today AWK is available on almost all UNIX/Linux systems
AWK itself is seldom used GAWK is the most popular version Normally not a go-to language

8 How to use it UNIX/Linux/Mac OS X – already installed
Windows – install Cygwin (its free!) Some websites are able to run AWK scripts Many online tutorials

9 What AWK did AWK was a major influence to Larry Wall (Perl) AWK:
#!/usr/bin/awk -f BEGIN { print “Hello world!” } Perl: #!/usr/bin/perl print “Hello world!\n”;

10 Built-in variables AWK has many built-in variables
All that were in AWK transferred to nawk/gawk One of the most common is “FS” – Field Separator Use to parse files “-F” in command line works the same

11 FS Question One Two:Three:4 Five #!/bin/awk -f { print $2 FS=":" }

12 Questions?


Download ppt "Kevin Taylor."

Similar presentations


Ads by Google