4 ms·
> And yet, at least for the Unix tools I've used, nobody did write an elaborate parser. sed and awk are the elaborate parsers that are used in complex unix com
by nanomonkey 6y ago
> And yet, at least for the Unix tools I've used, nobody did write an elaborate parser.
sed and awk are the elaborate parsers that are used in complex unix command line scripting.
- jb3689 6y agoI think what the OP is getting at is that the people writing the other command line tools didn't have to write that logic (and thankfully we can instead centralize it in a limited set of tools like sed and awk)
- nanomonkey 6y agoI may be mistaken, but I assumed that they meant that no parsing needed to be done between components, and that they just stream together, which is not really the case. You often have to use sed and awk (eleborate parsers) between different components to get the necessary portions of data from one component into the other...they don't just fit together like legos.
- fiddlerwoaroof 6y agoYeah but sed and awk are amazing “sharp tools” for this sort of task: they have a learning curve, but 100 characters of awk can do some amazing stuff.
- _bxg1 6y agoThere's some truth to that, although there's still something to be said for a lack of recursive structure. Regular expressions can only match a flat pattern. Working with a JSON expression, even if you already have a JSON parser on hand, is often going to add more complexity than parsing a flat line of raw text using a regular expression.