1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

scripts/iiab-diagnostics: 'which' command deprecated by Ubuntu 22.04

This commit is contained in:
A Holt 2021-11-25 16:11:58 -05:00 committed by GitHub
parent e6f5d5778c
commit 69ac0c1fad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,7 @@ function cat_cmd() { # $1 = command + params, $2 = explan
echo " $1 # $2" echo " $1 # $2"
echo "=IIAB==========================================================================" >> $outfile echo "=IIAB==========================================================================" >> $outfile
cmd=$(echo "$1" | sed 's/\s.*$//') # Keep command on left; Drop params on right cmd=$(echo "$1" | sed 's/\s.*$//') # Keep command on left; Drop params on right
pth=$(which $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right pth=$(command -v $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right
if [ "$2" = "" ]; then if [ "$2" = "" ]; then
echo "COMMAND: $pth$1" >> $outfile echo "COMMAND: $pth$1" >> $outfile
else else