Alfred Aho talks Awk
Posted by Michael Anckaert on Jul 15, 2008 in Links 'n stuff • No commentsComputerworld has an interview with Alfred V. Aho, where he talks about the history and continuing popularity of his pattern matching language. How it came to be and what’s behind it never decreasing popularity.
Don’t know what Awk is? Let’s see what Wikipedia tells us:
AWK is a general purpose programming language that is designed for processing text-based data, either in files or data streams, and was created at Bell Labs in the 1970s[1]. The name AWK is derived from the family names of its authors — Alfred Aho, Peter Weinberger, and Brian Kernighan; however, it is not commonly pronounced as a string of separate letters but rather to sound the same as the name of the bird, auk (which acts as an emblem of the language such as on The AWK Programming Language book cover). awk, when written in all lowercase letters, refers to the Unix or Plan 9 program that runs other programs written in the AWK programming language.
If that didn’t cut it for you, let’s have a look at a typical Awk program:
df|awk -v PCT=70 ‘NR==1||substr($5,1,index($5,”%”)-1)+0>=PCT’
This command pipes the output from df to awk. Awk then only prints out the mount points that have more than 70% usage. I think this example shows the power that is wielded by a proficient Awk programmer.
Feel like giving Awk a try? Then have a look at the Awk User’s Guide.