summaryrefslogtreecommitdiff
path: root/sh/functions.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'sh/functions.sh.in')
-rw-r--r--sh/functions.sh.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 57917ed..8b7356a 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