|
|
@ -1,9 +1,8 @@ |
|
|
#!/bin/dash |
|
|
|
|
|
|
|
|
|
|
|
## |
|
|
## |
|
|
# make definitions only when not already defined |
|
|
|
|
|
|
|
|
# some functions for file handling...this includes a kind of |
|
|
|
|
|
# include_once for shell scripts. This one also includes the |
|
|
|
|
|
# utils/program.sh file as it is needed in all scripts. |
|
|
# |
|
|
# |
|
|
|
|
|
|
|
|
command -v filename2symbol >/dev/null |
|
|
command -v filename2symbol >/dev/null |
|
|
if [ $? -ne 0 ] |
|
|
if [ $? -ne 0 ] |
|
|
then |
|
|
then |
|
|
@ -77,29 +76,7 @@ then |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
## |
|
|
|
|
|
# get and export the locations of used programs and export them |
|
|
|
|
|
# I assume that on every UNIX/shell variant at least [ is globally |
|
|
|
|
|
# available. I will use it throughout all other scripts without |
|
|
|
|
|
# checking for existence. |
|
|
|
|
|
# I also assume through all scripts that eval is available. |
|
|
|
|
|
# |
|
|
|
|
|
[ -z "${WHICH}" ] && WHICH="/usr/bin/which" |
|
|
|
|
|
[ -z "${UNAME}" ] && UNAME="$(${WHICH} uname)" |
|
|
|
|
|
[ -z "${GREP}" ] && GREP="$(${WHICH} grep)" |
|
|
|
|
|
[ -z "${AWK}" ] && AWK="$(${WHICH} awk)" |
|
|
|
|
|
[ -z "${SED}" ] && SED="$(${WHICH} sed)" |
|
|
|
|
|
[ -z "${ECHO}" ] && ECHO="$(${WHICH} echo)" |
|
|
|
|
|
[ -z "${SORT}" ] && SORT="$(${WHICH} sort)" |
|
|
|
|
|
[ -z "${TR}" ] && TR="$(${WHICH} tr)" |
|
|
|
|
|
[ -z "${PRINTF}" ] && PRINTF="$(${WHICH} printf)" |
|
|
|
|
|
[ -z "${LOGGER}" ] && LOGGER="$(${WHICH} logger)" |
|
|
|
|
|
[ -z "${NPROC}" ] && NPROC="$(${WHICH} nproc)" |
|
|
|
|
|
[ -z "${LSCPU}" ] && LSCPU="$(${WHICH} lscpu)" |
|
|
|
|
|
[ -z "${IP}" ] && IP="$(${WHICH} ip)" |
|
|
|
|
|
[ -z "${IFCONFIG}" ] && IFCONFIG="$(${WHICH} ifconfig)" |
|
|
|
|
|
|
|
|
|
|
|
export WHICH UNAME GREP AWK SED ECHO SORT TR PRINTF LOGGER NPROC LSCPU IP IFCONFIG |
|
|
|
|
|
|
|
|
include_once utils/programs.sh |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# vim: set ts=4 sw=4: |
|
|
# vim: set ts=4 sw=4: |