6 ms·
I 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 s
by pixelmonkey 2y ago
I 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.