4 ms·
Awk is actually amazing as long as you operate within its limitations and core problems that it solves well—it is definitely not limited to one-liners, but it h
by klodolph 4y ago
Awk is actually amazing as long as you operate within its limitations and core problems that it solves well—it is definitely not limited to one-liners, but it has other limitations.
It is just so damn good at the things it is good at, but nobody learns to use it, because learning Awk is inefficient in the grand scheme of things. There are better things you can learn.
There is one place where Awk has undeniable superiority—and that is its use in environments where bureaucratic rules prohibit the distribution of programs / code (Perl, Python), but where Awk is permitted.
- pphysch 4y agoA naive AWK solution (extract+transform text) will vastly outperform a naive Python solution in throughput and memory footprint. It's absolutely efficient to learn, because there isn't much to learn.
- klodolph 4y agoA lot of people already know how to write Python or Perl or something, and given that background, the case for learning Awk is more difficult. I mean, I like Awk, but I’ve also been programming for a long time and I’ve amortized the cost of learning Awk.
- pphysch 4y agoMy case for learning AWK is if you spend any significant chunk of time in the terminal (sysadmin, DevOps, data eng). Notwithstanding any other scripting languages you know. CLI world is full of bespoke text interfaces. AWK is the tool for dealing with those programmatically.