News for hackers. Stuff that matters.
Re:Why you should learn at least a little bit of Awk by gregable on Wednesday September 29, 2010 @12:47PM (#1740066)
My little story about building a "real" program in awk was really just a toy example - I did it to teach myself some awk. I wouldn't really recommend writing significant persistent scripts in awk that much, if only because nobody else will want to maintain them. I think the beauty of awk for me is the little tiny bits of one liners that I can string together to do a quick bit of ad-hoc work. Anything more and I agree with you - I'd pick a real programming language.
Re:Why you should learn at least a little bit of Awk by chaostheory on Wednesday September 29, 2010 @12:58PM (#1740100)
"I think the beauty of awk for me is the little tiny bits of one liners that I can string together to do a quick bit of ad-hoc work. "

Again, my point is that you can do the same thing in Ruby, Python, Perl, or Lua just as easily and fast as you can in Awk. Awk used to have a nice niche years back. It pretty much lost that niche the second Perl got popular. It's even more irrevant now that Ruby and Python are even easier and faster to build stuff with quickly

About the only real pragmatic reason I can think of for learning Awk is to migrate existing Awk scripts, that started as nice useful one liners but eventually evolved into spaghetti, to Python / Ruby

Re:Why you should learn at least a little bit of Awk by BrandonM on Wednesday September 29, 2010 @02:10PM (#1740424)
I'm pretty sure he's talking about simple command line work. You seem to be missing the point. Compare:

  | awk '{print $2}' | ...

  | python -c 'import sys
  for line in sys.stdin:
    try:
      print line.split()[1]
    except IndexError:
      print' | ...
Re:Why you should learn at least a little bit of Awk by microtherion on Wednesday September 29, 2010 @04:28PM (#1741022)
Yeah, but try

  | perl -nae 'print $F[1], "\n"'
  | ruby -nae 'puts $F[1]'
Your local python oil vendor may have a one liner for that language as well.
Re:Why you should learn at least a little bit of Awk by gregable on Friday October 01, 2010 @01:42AM (#1746141)
I still posit that awk '{print $1}' is simpler