mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-11-08 21:24:54 -05:00
move utils.sh to lib
This commit is contained in:
9
lib/utils.sh
Normal file
9
lib/utils.sh
Normal 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' ]
|
||||
}
|
||||
Reference in New Issue
Block a user