1. 2
    1. 0

      Maybe it’s just me, but this feels like a lot more of a pain than just using an awk or sed one-liner (or even the chains of cuts and heads and greps the post author seems to think are the only existing option) to parse some arbitrary text. This is a solution that fully structures semi-structured output from certain commands into JSON. I’m not convinced that learning the exact hierarchies it parses any given command’s output into is worth it. You’re already looking at a nightmare if you put this into a script and release it – the thread for this post on HN has a bit where someone was unable to get it to work, and the author says it’s because their locale isn’t set to en_US.utf8, as the parser is expecting.

      Semi-structured output is semi-structured, the only reason this program even works is because it’s trivial to parse the outputs of UNIX commands as text and get the desired information. So why not just do that, especially since you’ll still have to do that when interacting with anything other than the set of built-in commands understood by this program.