It seems that newer versions of bash have the &>
operator, which (if I understand correctly), redirects both stdout and stderr to a file (&>>
appends to the file instead, as Adrian clarified).
What's the simplest way to achieve the same thing, but instead piping to another command?
For example, in this line:
cmd-doesnt-respect-difference-between-stdout-and-stderr | grep -i SomeError
I'd like the grep to match on content both in stdout and stderr (effectively, have them combined into one stream).
Note: this question is asking about piping, not redirecting - so it is not a duplicate of the question it's currently marked as a duplicate of.
|&
shortcut, which I think is by far the most convenient solution to "redirect both stdout and stderr to a pipe". – Echinoid