Created
March 19, 2012 13:40
-
-
Save arunreddy/2112555 to your computer and use it in GitHub Desktop.
Bash : template
This file contains 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
#----------------------------------------------------------------------------------------------- | |
# Check for number of arguments, Initialize them. | |
#----------------------------------------------------------------------------------------------- | |
[[ -n $1 && -n $2 && -n $3 && -n $4 && -n $5 && -n $6 ]] || { echo "Invalid input.Check the usage.." >&2; usage; exit 1; } | |
# debecho (debug-echo), by Stefano Falsetto ### | |
# Will echo passed parameters only if DEBUG is set to a value. ### | |
debecho () { | |
if [ ! -z "$DEBUG" ]; then | |
echo "$1" >&2 | |
# ^^^ to stderr | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment