mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-02-28 22:09:11 -05:00
11 lines
222 B
Bash
11 lines
222 B
Bash
#!/bin/sh
|
|
|
|
is_function () {
|
|
declare -f -F $1 > /dev/null; return $?
|
|
}
|
|
|
|
# http://stackoverflow.com/a/1369211/183097
|
|
copy_function () {
|
|
is_function $1 || return 1
|
|
eval "$(echo "${2}()"; declare -f ${1} | tail -n +2)"
|
|
} |