AWK

In the Begining...


The original awk comes to us complements of the folks of Bell Labs who have given so much to the community over the years. The name awk is formed from the designers Alfred Aho, Peter Weinberger and Brian Kernughan. Personally I think they should have called it wak since it is great at wacking files.

CREATED 2016-05-16 14:37:10.0

00-24-E1

UPDATED 2016-05-18 14:53:29.0

And Then...


Over the years there have been many upgrades and improvements to the awk language as well as many new contributors to its fame. From the GNU version gawk to Michael Brennans's mawk and don't forget the New awk (nawk). It sometimes seems that one could put any letter of the alphabet in front of the letters awk and it would represent a version of the language.

CREATED 2016-05-17 15:06:50.0

00-24-E2

UPDATED 2017-01-07 11:18:13.0

How it Works...


awk is a regular language that supports constants and variables, boolean logic and control structures among other things. Keep in mind though, awk, like other scripting languages is weakly typed

awk is really good at searching files. It supports it's own flavor of regex and the language itself is data driven.

awk reads a line from a file as a Record. Each record is broken up into Fields based on a character stored in the FS variable which defaults to a space.

Fields are numbered $1 through $n for how ever many fields there are.

CREATED 2016-05-18 14:54:08.0

00-24-E4

UPDATED 2016-05-20 17:32:26.0

Command Line Basics...


The awk command line comes in two forms. Form 1 when the code is an argument (don't forget the single quotes):

awk 'code' input-file-1 input-file-2 input-file-n

and form 2 when the code is in a file:

awk -f program-file input-file-1 input-file-2 input-file-n

Note: If you leave out the input files, awk takes imput from standard input i.e. the keyboard.

CREATED 2016-05-20 15:03:14.0

00-24-E6

UPDATED 2016-05-27 13:35:40.0

Knowledge

L
I
N
K
S

DBID: db.wam

Page Server: Ithica

©2012 Leistware Data Systems

      Hello anonymous