3 ms·
As an aside I have foolishly never once thought that you could pipe both stdout and stderr to another program at the same time. You learn something new each day
by Tsiklon 2y ago
As an aside I have foolishly never once thought that you could pipe both stdout and stderr to another program at the same time. You learn something new each day.
- pixelmonkey 2y agoI knew you could do that, but never knew you could do it with "|&" as a shorthand. TIL! I found this comment in a bash documentation example to verify: # To send stderr through a pipe, "|&" was added to Bash 4 as an abbreviation for "2>&1 |".
- cmeacham98 2y agoFair warning - this is a bash-ism, so if you're writing a script that needs to run on multiple shells and/or a more primitive shell, you should avoid it.