Last active
November 12, 2017 14:05
-
-
Save peterver/c1dcd3eeeb720cae1428256e3278db1f to your computer and use it in GitHub Desktop.
Supress all output but still retrieve the exit code of a command
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
#!/bin/bash | |
rep=$(...INSERT_COMMAND_HERE... 2>&1 >/dev/null) | |
status=$? | |
echo "$status" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment