diff options
Diffstat (limited to 'sh/functions.sh.in')
-rw-r--r-- | sh/functions.sh.in | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sh/functions.sh.in b/sh/functions.sh.in index 57917ed3..8b7356aa 100644 --- a/sh/functions.sh.in +++ b/sh/functions.sh.in @@ -20,6 +20,15 @@ eoutdent() return 0 } +is_function() +{ + if [ -n "${BASH_VERSION}" ]; then + [ "$(type -t "$1")" = "function" ] + else + [ "$(type "$1" 2>/dev/null)" = "$1 is a shell function" ] + fi +} + yesno() { [ -z "$1" ] && return 1 |