News for hackers. Stuff that matters.
Re:jc: Converts the output of popular command-line tools to ... by Izkata on Friday December 08, 2023 @03:40PM (#38574022)
> I actually wish there was just a third standard output for machine readable content, which your terminal doesn’t print by default. When you pipe, this output is what gets piped (unless you redirect), it’s expected to be jsonl, and the man page is expected to specify a contract.

Except for that last jsonl part, various commands already do something like this with stdout by detecting what's on the other end.

https://unix.stackexchange.com/questions/515778/how-does-a-p...

Re:jc: Converts the output of popular command-line tools to ... by mistercow on Sunday December 10, 2023 @12:53AM (#38589483)
Yeah, but it's kind of a mess. You have multiple options when implementing it without a clear standard, and in practice, it's a lot trickier to make sure that all of your code does this consistently than it is to simply use different file descriptors for different output types.

And then if the user wants to debug their script, they need to know to pipe your command to `cat` or whatever to see what's actually getting passed through.