Linked by Tony Steidler-Dennison on Tue 15th Jul 2008 14:35 UTC, submitted by LinucksGirl
General Development Awk is a very nice language with a very strange name. In this first article of a three-part series, start playing around with awk to see how it works and quickly get your awk programming skills up to speed. As the series progresses, more advanced topics will be covered, culminating with an advanced real-world awk application demo.
Permalink for comment 323756
To read all comments associated with this story, please click here.
Awk is a Great Language?!
by ShlomiFish on Sun 20th Jul 2008 13:11 UTC
ShlomiFish
Member since:
2005-10-10

What the hell? To quote what ESR said about Awk in "The Art of Unix Programming" ( http://www.faqs.org/docs/artu/ch08s02.html#awk ):

{{{{{{{{{{
A case study of awk is included to point out that it is not a model for emulation; in fact, since 1990 it has largely fallen out of use. It has been superseded by new-school scripting languages—notably Perl, which was explicitly designed to be an awk killer. The reasons are worthy of examination, because they constitute a bit of a cautionary tale for minilanguage designers.

The awk language was originally designed to be a small, expressive special-purpose language for report generation. Unfortunately, it turns out to have been designed at a bad spot on the complexity-vs.-power curve. The action language is noncompact, but the pattern-driven framework it sits inside keeps it from being generally applicable — that's the worst of both worlds. And the new-school scripting languages can do anything awk can; their equivalent programs are usually just as readable, if not more so.
}}}}}}}}}}}

As someone who eats, lives and breathes Perl almost everyday, including for some "more serious" applications and APIs development, I find Awk to be incredibly limited, confusing, and kludgy. Perl is much more consistent, does not enforce awk's line-based coding (though it can be added using some http://perldoc.perl.org/perlrun.html command line flags), and is a serious programming. So I've noticed that I've been using variations on "perl -e" instead of Awk (and instead of sed) instead.

Awk knowledge is useful in understanding other people's old shell code, but it's a stupid and old language that falls between the chairs and should be put to sleep. Just do yourself a favour and use Perl or Ruby or whatever.

Reply Score: 1