6 ms·
I gave up on awk when Perl became available, and after that, Python. However, after reading this interview, I think I should relearn it.
by greggraham 17y ago
I gave up on awk when Perl became available, and after that, Python. However, after reading this interview, I think I should relearn it.
- sketerpot 17y agoIt's very handy when you're working with delimiter-separated data. I've never bothered to learn the more powerful features of awk, because Python is generally better for sufficiently complicated text processing, but for little one-off scripts, awk is a nice thing to know.
- silentbicycle 17y agoRight. Awk is great for the sweet spot of 1-3 line filters, and the subset of the language needed for most of those could fit on half a page. You could do bigger stuff with it, but at that point it's probably better done in another language. There are surprisingly many cases where a few lines of awk is good enough, though. Perl is logically a superset of awk, but there's so much more in the core language that I kept forgetting parts of it.