|
|
Subscribe / Log in / New account

Surprisingly relevant?

Surprisingly relevant?

Posted May 20, 2020 4:08 UTC (Wed) by marduk (subscriber, #3831)
In reply to: Surprisingly relevant? by NYKevin
Parent article: The state of the AWK

I never see "{ print $1 }", or rather, most of the time when see someone has turned to awk it's because their problem has evolved into something more complicated than "{ print $1 }".

You could resort to some kind of permutation of set, cut, in trivial cases where spawning a bunch of processes to do what awk can do by itself is acceptable to you.


to post comments

Surprisingly relevant?

Posted May 20, 2020 20:01 UTC (Wed) by jafd (subscriber, #129642) [Link]

I was using it because a fat book about administering Red Hat Linux (from when Red Hat Linux 6 was a newfangled thing) gave it in a useful example. It went downhill from there.

Also, back when the whole Unicode mess had been a very on-and-off experience, where some tools would work and some would go bonkers, cut failed me a couple times and awk was solid. And so it went.

Surprisingly relevant?

Posted May 20, 2020 20:29 UTC (Wed) by NYKevin (subscriber, #129325) [Link] (1 responses)

> where spawning a bunch of processes to do what awk can do by itself is acceptable to you.

Why do I care? I have gigabytes of RAM and it's not like I'm going to run out of PIDs from a five-command pipeline. Besides, the kernel should be COWing glibc etc. so it's not even all that much overhead to begin with. If you're using something like Toybox/Busybox/whatever-other-box-is-popular-these-days, then you can literally COW the entire executable.

Surprisingly relevant?

Posted Nov 19, 2020 13:29 UTC (Thu) by nenad_noveljic (guest, #143180) [Link]

Forking is an expensive OS call. It might cause a problem when used occasionally in the command line. But it will consume substantial kernel CPU if done on a large scale.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds