move utils.sh to lib

This commit is contained in:
Patrick Stadler
2015-02-21 18:51:23 +01:00
parent abd2175a84
commit a827a71513
2 changed files with 1 additions and 1 deletions

9
lib/utils.sh Normal file
View File

@@ -0,0 +1,9 @@
# http://stackoverflow.com/a/1369211/183097
copy_function () {
declare -F $1 > /dev/null || return 1
eval "$(echo "${2}()"; declare -f ${1} | tail -n +2)"
}
is_function () {
[ "`type -t $1`" == 'function' ]
}