News for hackers. Stuff that matters.
Re:All software is web software now by tester756 on Thursday June 09, 2022 @12:07PM (#31682961)
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

Re:All software is web software now by ilyash on Thursday June 09, 2022 @01:02PM (#31683785)
The idea of JSON output is brought up regularly.

Very interesting project that helps with that is https://wiki.freebsd.org/LibXo

Meanwhile, there is jc so that

jc df

returns JSON. See https://github.com/kellyjonbrazil/jc

Hope this helps.

Re:All software is web software now by thibran on Thursday June 09, 2022 @12:11PM (#31683029)
Or 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.
Re:All software is web software now by tester756 on Thursday June 09, 2022 @12:18PM (#31683122)
What 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?