Created
November 15, 2012 19:23
-
-
Save florian/4080618 to your computer and use it in GitHub Desktop.
Execute a bash command without output
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
# OK, so I'm terrible at bash and the code below might be terrible, too, but it does the work for me. :3 | |
function silent { | |
echo $* | sh >/dev/null 2>&1 | |
} | |
# Usage: | |
silent echo hai world | |
silent make server | |
# BTW: Only the first command passed to the function will be silented. | |
silent echo a; echo b; echo c # Will output: b\nc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment