mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
1.0 KiB
1.0 KiB
Redirect outputs
TL;DR
Pipes are set up before the I/O redirections are interpreted.
The sequence of I/O redirections is interpreted left-to-right.
command 2>&1 >'/dev/null' | grep 'something'
command 2>'/dev/stdout' 1>'/dev/null' | grep 'something'
# Swap the standard error and standard output over, then close the spare descriptor used for the swap.
command 3>&1 1>&2 2>&3 3>&-