Commit eb7fdf20b235b83c65f5e3d4ce46218d46b50a32
1 parent
429425fc
do not print an error message when a program can't be found
Showing
1 changed file
with
14 additions
and
13 deletions
... | ... | @@ -6,19 +6,20 @@ |
6 | 6 | # I also assume through all scripts that eval is available. |
7 | 7 | # |
8 | 8 | [ -z "${WHICH}" ] && WHICH="/usr/bin/which" |
9 | -[ -z "${UNAME}" ] && UNAME="$(${WHICH} uname)" | |
10 | -[ -z "${GREP}" ] && GREP="$(${WHICH} grep)" | |
11 | -[ -z "${AWK}" ] && AWK="$(${WHICH} awk)" | |
12 | -[ -z "${SED}" ] && SED="$(${WHICH} sed)" | |
13 | -[ -z "${ECHO}" ] && ECHO="$(${WHICH} echo)" | |
14 | -[ -z "${SORT}" ] && SORT="$(${WHICH} sort)" | |
15 | -[ -z "${TR}" ] && TR="$(${WHICH} tr)" | |
16 | -[ -z "${PRINTF}" ] && PRINTF="$(${WHICH} printf)" | |
17 | -[ -z "${LOGGER}" ] && LOGGER="$(${WHICH} logger)" | |
18 | -[ -z "${NPROC}" ] && NPROC="$(${WHICH} nproc)" | |
19 | -[ -z "${LSCPU}" ] && LSCPU="$(${WHICH} lscpu)" | |
20 | -[ -z "${IP}" ] && IP="$(${WHICH} ip)" | |
21 | -[ -z "${IFCONFIG}" ] && IFCONFIG="$(${WHICH} ifconfig)" | |
9 | +[ -z "${UNAME}" ] && UNAME="$(${WHICH} uname 2>/dev/null)" | |
10 | +[ -z "${GREP}" ] && GREP="$(${WHICH} grep 2>/dev/null)" | |
11 | +[ -z "${AWK}" ] && AWK="$(${WHICH} awk 2>/dev/null)" | |
12 | +[ -z "${SED}" ] && SED="$(${WHICH} sed 2>/dev/null)" | |
13 | +[ -z "${ECHO}" ] && ECHO="$(${WHICH} echo 2>/dev/null)" | |
14 | +[ -z "${SORT}" ] && SORT="$(${WHICH} sort 2>/dev/null)" | |
15 | +[ -z "${TR}" ] && TR="$(${WHICH} tr 2>/dev/null)" | |
16 | +[ -z "${PRINTF}" ] && PRINTF="$(${WHICH} printf 2>/dev/null)" | |
17 | +[ -z "${LOGGER}" ] && LOGGER="$(${WHICH} logger 2>/dev/null)" | |
18 | +[ -z "${NPROC}" ] && NPROC="$(${WHICH} nproc 2>/dev/null)" | |
19 | +[ -z "${LSCPU}" ] && LSCPU="$(${WHICH} lscpu 2>/dev/null)" | |
20 | +[ -z "${SYSCTL}" ] && SYSCTL="$(${WHICH} sysctl 2>/dev/null)" | |
21 | +[ -z "${IP}" ] && IP="$(${WHICH} ip 2>/dev/null)" | |
22 | +[ -z "${IFCONFIG}" ] && IFCONFIG="$(${WHICH} ifconfig 2>/dev/null)" | |
22 | 23 | |
23 | 24 | export WHICH UNAME GREP AWK SED ECHO SORT TR PRINTF LOGGER NPROC LSCPU IP IFCONFIG |
24 | 25 | ... | ... |
Please
register
or
login
to post a comment