*** Please type your report below this line ***
The manpage says:
"[1] If |& is used, the standard error of command is connected to
command2's standard input through the pipe; [2] it is shorthand for
2>&1 |. This implicit redirection of the standard error is
performed after any redirections specified by the command."
At first glance, [1] and [2] say the same, but that's not so, as
this example shows:
% sh -c 'echo stdout; echo stderr >&2' > /dev/null |& cat
Here, both stdout and stderr are redirected to /dev/null. That's
what [2] says, but not what [1] says.
So at the very least this is a documentation bug, and the manpage
should say:
"If |& is used, the standard error of command is connected to
whatever the standard output is connected to which may or may not be
the pipe to command2's standard input;"
However, I wonder if the behaviour is really very meaningful. Since
the "|&" token refers to the pipe syntactically, one would naively
expect that its behaviour has to do with the pipe. Of course, it's
easy to work-around by wrapping the command in a subshell which does
what I'd have expected:
% (sh -c 'echo stdout; echo stderr >&2' > /dev/null) |& cat
stderr