Created
September 17, 2013 13:38
-
-
Save gonzaloserrano/6594400 to your computer and use it in GitHub Desktop.
How to less stderr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/2342826/how-to-pipe-stderr-and-not-stdout | |
# This creates a new file descriptor (3) and assigns it to the same place as 1 (stdout), | |
# then assigns fd 1 (stdout) to the same place as fd 2 (stderr) and finally assigns fd 2 (stderr) | |
# to the same place as fd 3 (stdout). Stderr is now available as stdout and old stdout preserved in stderr. | |
command 3>&1 1>&2 2>&3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment