Open lonnywong opened 2 months ago
Yes.
Stdout = Information that user requested, interactive elements, payload Stderr = Diagnostics, logging, errors, stuff you don't want to include when capturing/redirecting payload
Things like foo --help | less
, foo --help | grep -i color
and foo --version | grep -q v1.20.
should work without redirecting stderr to stdout.
The openssh client outputs version and help message to stderr.
/usr/bin/ssh 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
/usr/bin/ssh -V 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
/usr/bin/ssh -h 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
The output goes to /tmp/ssh.stderr
, but not /tmp/ssh.stdout
.
Related to https://github.com/Homebrew/homebrew-core/pull/181568.