Last active
January 2, 2016 23:39
-
-
Save coderofsalvation/8377399 to your computer and use it in GitHub Desktop.
This function checks if an defined function or command exist.
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
| # This function checks if an defined function or command exist. | |
| # | |
| # @param string $1 function name (required) | |
| # @return bool | |
| # @example: is_function "rc_myfunc" || exit 1 | |
| is_function() { | |
| type "$1" &>/dev/null && return 0 || return 1 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment