diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-04-06 15:22:02 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-04-06 15:35:55 +0200 |
commit | 4a4014391b6be9629046fbbd1968e175805ed9d4 (patch) | |
tree | 4f4ee5cf4028cd7a49b21ee74065ca8348ce9631 | |
parent | ce1dd127fc892083318754f857dec6cf9579aae2 (diff) | |
download | mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.tar mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.tar.gz mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.tar.bz2 mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.tar.lz mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.tar.xz mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.tar.zst mbuto-4a4014391b6be9629046fbbd1968e175805ed9d4.zip |
mbuto: Use which(1) instead of 'command -v' to look for program paths
The output of 'command -v' varies widely across shells, which(1)
output looks relatively consistent.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-x | mbuto | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -285,7 +285,7 @@ profile_kselftests() { # List of tools used here, assigned to uppercase variable names TOOLS="basename bc cat cd chmod cp cpio depmod diff dirname du file find grep gzip ldconfig ldd ln ls make mkdir mknod mktemp modprobe mv printf - readlink realpath rm rmdir seq sleep strip sync umount uname wget" + readlink realpath rm rmdir seq sleep strip sync umount uname wget which" # err() - Print error and exit # $@: Error message, optionally with printf format and arguments @@ -615,10 +615,9 @@ prog_add() { IFS=',' for __a in ${1}; do - __bin="$(command -v "${__a}")" && break + __bin="$(${WHICH} "${__a}")" && break done unset IFS - [ -z "${__bin}" ] && err "Can't source ${1}" # Binaries in /usr/libexec are meant to run on other hosts only, so they |