Skip to content

Instantly share code, notes, and snippets.

@NeMO84
Created December 13, 2015 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NeMO84/df84d65485a06c31d333 to your computer and use it in GitHub Desktop.
Save NeMO84/df84d65485a06c31d333 to your computer and use it in GitHub Desktop.
#!/bin/bash
# http://stackoverflow.com/questions/85880/determine-if-a-function-exists-in-bash
function_exists() {
declare -f -F $1 > /dev/null
return $?
}
# function_exists function_name && echo Exists || echo No such function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment