3 ms·
We need e.g Linux basic tools to switch / start supporting web-ish data format - json as their output e.g df -h --json so we do not need parsers for every too
by tester756 4y ago
We need e.g Linux basic tools to switch / start supporting web-ish data format - json as their output e.g
df -h --json
so we do not need parsers for every tool, but one coherent format which is already popular and has built in parser for every lang out there
- thibran 4y agoOr just use a shell that understands JSON and can just pipe the output to JSON. In Nushell you can query the free space and then add `| to json` and you are done.
- tester756 4y agoWhat do you mean? how it'd work for the "df -h | to_json"? could you please paste the json you're receiving? how does it understand the structure returned yb df -h?
- ilyash 4y agoThe idea of JSON output is brought up regularly. Very interesting project that helps with that is https://wiki.freebsd.org/LibXo https://wiki.freebsd.org/LibXo Meanwhile, there is jc so that jc df returns JSON. See https://github.com/kellyjonbrazil/jc https://github.com/kellyjonbrazil/jc Hope this helps.