News for hackers. Stuff that matters.
Re:Why you should learn just a little Awk - A Tutorial by Ex... by moe on Saturday August 27, 2011 @06:33PM (#2932738)
Mostly chains of sort, uniq, sed, tr, comm and friends.

Anything that doesn't fit into 80 chars that way is usually a sure sign that it's time to reach for a real scripting language rather than brewing up one of those line-noise blobs.

Oh, and of course I don't mind when people use it on their shell-prompt.

I do mind when I run into crap like this in a shell-script:

  awk -F'>' '{ pack[$1]=pack[$1] $2 } END {for (val in pack) print val ">", "(" pack[val] ")"}'
Re:Why you should learn just a little Awk - A Tutorial by Ex... by mattdeboard on Saturday August 27, 2011 @08:28PM (#2932933)
Wait, you're buttressing your argument that people shouldn't use awk because it's 2011, by advocating equally complex command composition with more tools? I mean, I love sort and uniq but your opposition to awk sounds more like religious zealotry than anything rational.

"It's 2011, time for a sed v. awk religious war!"

Re:Why you should learn just a little Awk - A Tutorial by Ex... by burgerbrain on Sunday August 28, 2011 @03:54AM (#2933557)
"Mostly chains of sort, uniq, sed, tr, comm and friends."

Awk wasn't invented for lack of those things, Awk was invented to supplement those things. And for that purpose it is every bit as relevant today as it ever was.

P.S. Properly formatted, that awk line is perfectly sensible. I don't see what your issue here is.

Re:Why you should learn just a little Awk - A Tutorial by Ex... by 4ad on Saturday August 27, 2011 @06:37PM (#2932744)
Crap can be written in any language, no language is imune and no language is better in this regard.
Re:Why you should learn just a little Awk - A Tutorial by Ex... by moe on Saturday August 27, 2011 @06:47PM (#2932760)
Except that in awk the middle-ground between "could be trivially done without awk" and "illegible" is extremely narrow.

When I 'grep awk /usr/bin/*' then I see only two types of usages.

Most commonly it's used in place of grep, sed or cut for no obvious reason. Gladly less common but all the more annoying is when someone tries to go all "fancy" with it...

Re:Why you should learn just a little Awk - A Tutorial by Ex... by keenerd on Saturday August 27, 2011 @07:37PM (#2932852)
Awk has everything "real" languages have. The same math, flow control and data structures. It also has a subset of string mangling ops that give it the "illegible" appearance. But it is fine as a general purpose dynamic scripting language. As an example:

http://kmkeen.com/awk-music/

It could be clearer without the variable-name golfing and as a seperate .awk file (instead of a CLI one-liner) but it reads pretty much the same as C without any pesky type declarations.

Re:Why you should learn just a little Awk - A Tutorial by Ex... by rhizome on Saturday August 27, 2011 @06:47PM (#2932759)
a sure sign that it's time to reach for a real scripting language

Awk is Turing-complete.

Re:Why you should learn just a little Awk - A Tutorial by Ex... by glenjamin on Saturday August 27, 2011 @07:19PM (#2932819)
So is brainfuck, and whitespace. This isn't really a useful thing to point out.

For any sort of script thats going to be run many times and may need to be improved or extended, readability is a huge plus.

Re:Why you should learn just a little Awk - A Tutorial by Ex... by jff on Sunday August 28, 2011 @12:33PM (#2934251)
Awk is incredibly readable in a shell script. It's a proper scripting language that actually looks cleaner than the Bourne shell.
Re:Why you should learn just a little Awk - A Tutorial by Ex... by rhizome on Sunday August 28, 2011 @04:49PM (#2934929)
BF and whitespace are LOLCODE, and thus not "real" for my purposes.
Re:Why you should learn just a little Awk - A Tutorial by Ex... by cdcarter on Saturday August 27, 2011 @07:44PM (#2932867)
So is brainfuck...