Pipe command output, but keep the error code
14209
Pipe output and capture exit status in Bash
142776
PowerShell: Capture the output from external process that writes to stderr in a variable
31959
How to redirect and append both stdout and stderr to a file with Bash?
157434
How do I diff the outputs of two commands?
58030
How can I use a file in a command and redirect output to the same file without truncating it?
22002
How can I capture stdout/stderr in a file but still see it in my console?
79630
Redirect STDERR and STDOUT to different variables without temporary files
5500
Redirect all subsequent commands' stderr using exec
14304
Why does bash output data instead of executing, when a script is piped?
19312
Is there a way to redirect a program's output and still have it go to stdout?
157458
Cannot use awk pipe output
79347
Is it possible to save output from a command to a file after the command already has been executed?
82820
How to make a pipeline wait for end-of-file or stop after an error?
80523
Capture stdout and stderr into different variables
81714
Piping STDERR vs. STDOUT
31746
How do I redirect command completion output?
130655
What is the name of the command (function) that runs after a command has failed?