Ubuntu started to flag which as deprecated and it seems which is not really standard and may vary across Distro. Drop the use of which and use the standard 'command -v' for this simple task. Which is still present in the prereq if some package/script still use which. A utility script called command_all.sh is implemented that will just mimic the output of which -a. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>openwrt-22.03
parent
87d489f67a
commit
88204bfa82
@ -0,0 +1,11 @@
|
||||
#! /bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Reduced version of which -a using command utility
|
||||
|
||||
case $PATH in
|
||||
(*[!:]:) PATH="$PATH:" ;;
|
||||
esac
|
||||
|
||||
for ELEMENT in $(echo $PATH | tr ":" "\n"); do
|
||||
PATH=$ELEMENT command -v "$@"
|
||||
done
|
Loading…
Reference in new issue