Created
August 14, 2013 17:35
-
-
Save btm/6233398 to your computer and use it in GitHub Desktop.
Using grep against 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
# This error goes to STDERR | |
$ asdfasdf | |
-bash: asdfasdf: command not found | |
# We redirect STDERR to STDOUT, but STDOUT to null, so we can use grep against STDERR | |
$ asdfasdf 2>&1 >/dev/null | grep -q not ; echo $? | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment