Created
September 13, 2016 17:07
-
-
Save dwallraff/d0e22cec8fdf73bf50e13d522b9de979 to your computer and use it in GitHub Desktop.
Simple way to print debug messages in bash
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
| function debug() { | |
| if [[ $DEBUG ]] | |
| then | |
| echo ">>> $*" | |
| fi | |
| } | |
| # For any debug message | |
| debug "Trying to find config file" | |
| # function debug() { ((DEBUG)) && echo ">>> $*"; } | |
| # function debug() { [ "$DEBUG" ] && echo ">>> $*"; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment