mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-11-08 21:24:54 -05:00
add commands for osx
This commit is contained in:
12
lib/utils.sh
12
lib/utils.sh
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# http://stackoverflow.com/a/1369211/183097
|
||||
copy_function () {
|
||||
declare -F $1 > /dev/null || return 1
|
||||
@@ -6,4 +8,12 @@ copy_function () {
|
||||
|
||||
is_function () {
|
||||
[ "`type -t $1`" == 'function' ]
|
||||
}
|
||||
}
|
||||
|
||||
OS_TYPE=$(case "$OSTYPE" in
|
||||
(solaris*) echo solaris;;
|
||||
(darwin*) echo osx;;
|
||||
(linux*) echo linux;;
|
||||
(bsd*) echo bsd;;
|
||||
(*) echo unknown;;
|
||||
esac)
|
||||
Reference in New Issue
Block a user