Is there any way, in bash, to pipe STDERR through a filter before unifying it with STDOUT? That is, I want
STDOUT ────────────────┐
├
I find the use of bash process substitution easier to remember and use as it reflects the original intention almost verbatim. For example:
$ cat ./p
echo stdout
echo stderr >&2
$ ./p 2> >(sed -e 's/s/S/') | sed 's/t/T/'
sTdout
STderr
uses the first sed command as a filter on stderr only and the second sed command to modify the joined output.
Note that the white space after 2> is mandatory for the command to be parsed correctly.