| ▲ | vessenes 5 hours ago | ||||||||||||||||||||||
Not sure why this link and/or question is here, except to say LLMs like this incantation. It redirects STDERR (2) to where STDOUT is piped already (&1). Good for dealing with random CLI tools if you're not a human. | |||||||||||||||||||||||
| ▲ | WhyNotHugo 5 hours ago | parent | next [-] | ||||||||||||||||||||||
Humans used this combination extensively for decades too. I'm no aware of any other simple way to grep both stdout and stderr from a process. (grep, or save to file, or pipe in any other way). | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | ElijahLynn 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
I found the explanation useful, about "why" it is that way. I didn't realize the & before the 1 means to tell it is the filedescriptor 1 and not a file named 1. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | anitil 4 hours ago | parent | prev [-] | ||||||||||||||||||||||
I've also found llms seem to love it when calling out to tools, I suppose for them having stderr interspersed messaged in their input doesn't make much difference | |||||||||||||||||||||||