Skip to content

Instantly share code, notes, and snippets.

@btm
Created August 14, 2013 17:35

Revisions

  1. btm created this gist Aug 14, 2013.
    7 changes: 7 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # 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