4 ms·
Couldn't there be a middle ground where command and object member names have nice short aliases, but they work on and produce objects instead of character strea
by m_mueller 10y ago
Couldn't there be a middle ground where command and object member names have nice short aliases, but they work on and produce objects instead of character streams? I find it questionable that the productivity of the unix shell is due to it being stream-only - it could easily fall back to a stream (using each classes representation function) if you output it to a stream receiver, like the terminal itself or a text file.
- derekp7 10y agoThat's what I'd like to see, is to add a "--xml" or "--json" flags to any common command (such as ps, ls, grep, find, ...). And have appropriate handling in the shell for xml or json output.
- emaste 10y agoMany FreeBSD utilities support a --libxo flag that produces structured output, although there isn't special handling in shells yet. % ls --libxo json {"__version": "1", "file-information": {"directory":[{"entry": [{"name":"bar"}, {"name":"foo"}]}]} } % ls --libxo xml <file-information __version="1"><directory><entry><name>bar</name></entry><entry><name>foo</name></entry></directory></file-information>