/which/command -v/

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2012-06-25 20:19:10 +02:00
parent 2856684e51
commit d13a201cd0
8 changed files with 9 additions and 9 deletions

View File

@ -20,6 +20,6 @@
#
#
if which hostname >/dev/null 2>&1; then
if command -v hostname; then
hostname
fi

View File

@ -24,12 +24,12 @@
#
# Use ip, if available
if which ip >/dev/null 2>&1; then
if command -v ip; then
ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p'
exit 0
fi
if ! which ifconfig >/dev/null 2>&1; then
if ! command -v ifconfig; then
# no ifconfig, nothing we could do
exit 0
fi

View File

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_CODENAME")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
lsb_release=$(command -v lsb_release)
if [ -x "$lsb_release" ]; then
$lsb_release --short --codename
fi

View File

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
lsb_release=$(command -v lsb_release)
if [ -x "$lsb_release" ]; then
$lsb_release --short --description
fi

View File

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_ID")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
lsb_release=$(command -v lsb_release)
if [ -x "$lsb_release" ]; then
$lsb_release --short --id
fi

View File

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_RELEASE")
;;
*)
lsb_release=$(which lsb_release 2>/dev/null)
lsb_release=$(command -v lsb_release)
if [ -x "$lsb_release" ]; then
$lsb_release --short --release
fi

View File

@ -22,6 +22,6 @@
#
#
if which uname >/dev/null 2>&1; then
if command -v uname; then
uname -m
fi

View File

@ -20,7 +20,7 @@
#
set +e
executable=$(which runlevel 2>/dev/null)
executable=$(command -v runlevel)
if [ -x "$executable" ]; then
"$executable" | awk '{ print $2 }'
fi