Live data from Hacker News

Awk: The Power and Promise of a 40-Year-Old Language

fosslife.org

1–10 of 122 posts

Re: Awk: The Power and Promise of a 40-Year-Old Language

#2
HN discussion threads for some of the links mentioned in the article:

* Using AWK and R to parse 25TB - https://news.ycombinator.com/item?id=20293579

* Command-line Tools can be 235x Faster than a Hadoop Cluster - https://news.ycombinator.com/item?id=17135841

* The State of the AWK - https://news.ycombinator.com/item?id=23240800

For awk alternative implementations, I'm keeping an eye on frawk [0]. Aims to be faster, supports csv, etc.

[0] https://github.com/ezrosent/frawk

Re: Awk: The Power and Promise of a 40-Year-Old Language

#4
Gawk's ability to extend it with C code is interesting as well, and pretty straightforward.

Here's the source for the fork() extension that ships with gawk...it's ~150 lines or so: https://git.savannah.gnu.org/cgit/gawk.git/tree/extension/fo...

I was able to make a (terrible/joke/but-it-kinda-works) web server with gawk using the extensions that ship with it: https://gist.github.com/willurd/5720255#gistcomment-3143007

Re: Awk: The Power and Promise of a 40-Year-Old Language

#6
post #5

i no longer use it but Perl was always the better solution when one thought AWK was the answer. Perl will do those things where AWK really shines and if the problem got bigger, Perl was easier to deal with.

I found that to be the case many times as well. But awk also often outperforms Perl, especially mawk.

Re: Awk: The Power and Promise of a 40-Year-Old Language

#7
I only recently learned Awk enough to be useful. But I still don't reach for it when I probably should.

What are the most common cases where you reach for Awk instead of some other tools?

I recently used it to parse and recombine data from the OpenVPN status file. That file has a few differently formatted tables in the same file. Using Awk, I was able to change a variable as each table was encountered, this I could change the Awk program behavior by which table it was operating on.

Re: Awk: The Power and Promise of a 40-Year-Old Language

#9
post #5

i no longer use it but Perl was always the better solution when one thought AWK was the answer. Perl will do those things where AWK really shines and if the problem got bigger, Perl was easier to deal with.

Yes but you can't learn perl as quickly as you can learn awk.

Re: Awk: The Power and Promise of a 40-Year-Old Language

#10

I only recently learned Awk enough to be useful. But I still don't reach for it when I probably should. What are the most common cases where you reach for Awk instead of some other tools? I recently used it to parse and recombine data from the OpenVPN status file. That file has a few differently formatted tables in the same file. Using Awk, I was able to change a variable as each table was encountered, this I could c…

try running this: awk '{cmd="rm " FILENAME; print cmd; system(cmd) }' file*

best results if you do 'sudo' first

ymmv

Post reply on HN