Hacker News new | past | comments | ask | show | jobs | submit login

What if we added json output mode to all shell commands? Or at least make some wrappers that parse their unstructured text output into json.

We would be able to use standard pipelines and jq to filter/query outputs, without any custom shells.

Just imagine:

    ifconfig --json | jq '.[] | [.interface, .inet] | @tsv'



You're not the first person to think of that. See Juniper's libxo: https://github.com/Juniper/libxo

It's integrated into a lot of FreeBSD's command line tooling, and is very useful, when it's available.


So a lot of FreeBSD command line tools support JSON output? That's cool! And I wish it was linux...


I am with you in principle - but I still don't get the jq path/filter syntax I'm afraid. I think I'd vastly prefer map/reduce/zip commandlets...

Ed: I'd say from a quick glance that I think I rather prefer nushell to powershell


There is some movement in this direction: e.g. it's possible to do `ip -j addr` today.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: