News for hackers. Stuff that matters.
Re:The Beauty of Unix Pipelines (2020) by cperciva on Saturday June 04, 2022 @11:23PM (#31627711)
Obviously you could create a shell alias or write a new utility for that -- but if you're wondering why there isn't a standard UNIX utility for doing that: All the standard text processing utilities were designed in the context of processing files which didn't fit into memory -- with the exception of sort (which uses temporary files) they're all streaming utilities which keep at most a handful of lines in memory at once.

The "normal" way of doing "count how many times lines are present and list them in decreasing order" is to use a hash table which keeps all the (unique) lines in memory -- so that utility simply wasn't possible when all the standard tools were invented.

There are no comments on this comment yet.