3 ms·
My personal view: It is often said that the basic data format of Unix is unstructured text. This isn't true; the standard text chomping utilities are rather or
by dTal 6y ago
My personal view:
It is often said that the basic data format of Unix is unstructured text. This isn't true; the standard text chomping utilities are rather oriented around a very basic kind of structured text, in which newlines delineate the highest level of semantic subdivision (and whitespace often delineates the next level down). This is an excellent format, which allows the easy composition of lazy pipelines that operate on one chunk ("line") at a time. Unfortunately, few tools actually generate this format properly, frequently splitting a single semantic unit over multiple lines so that it looks pretty in a terminal. This breaks the fundamental user interaction model that the console toolchain was designed around, requiring the user to write elaborate parsers every time they want to move data around.
I'm also annoyed that 'cut' doesn't collapse whitespace, not even optionally; the usual retort to this complaint is "use awk", an entire programming language. So much for "do one thing well".