Last active
December 17, 2015 08:18
-
-
Save danidiaz/5579007 to your computer and use it in GitHub Desktop.
bash stuff
This file contains 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
cat | grep foo | |
{ cat aabsdf.xx 2>&1 ; } 2>/dev/null | |
# http://stackoverflow.com/questions/2342826/how-to-pipe-stderr-and-not-stdout?rq=1 | |
# http://www.gnu.org/software/bash/manual/bashref.html#Redirections | |
# http://mywiki.wooledge.org/Redirection | |
{ ls ; cat ; } | grep foo | |
{ echo "foo" ; cat ; } | grep foo | |
# the right part of a pipe only receives the stdout of the left part | |
# swaps stdin and stdout! | |
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