Is there any way, in bash, to pipe STDERR through a filter before unifying it with STDOUT? That is, I want
STDOUT ────────────────┐
├
The last part of this page of the Advanced Bash Scripting Guide is "redirecting only stderr to a pipe".
# Redirecting only stderr to a pipe.
exec 3>&1 # Save current "value" of stdout. ls -l 2>&1 >&3 3>&- | grep bad 3>&- # Close fd 3 for 'grep' (but not 'ls'). # ^^^^ ^^^^ exec 3>&- # Now close it for the remainder of the script.
# Thanks, S.C.
This may be what you want. If not, some other part of the ABSG should be able to help you, it is excellent.