1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #3048 from holta/which-command-deprecated-by-u22

scripts/iiab-diagnostics: 'which' command deprecated by Ubuntu 22.04 [use `command -v' instead]
This commit is contained in:
A Holt 2021-11-25 16:14:39 -05:00 committed by GitHub
commit 5f6eb6d16b
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 "=IIAB==========================================================================" >> $outfile
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
echo "COMMAND: $pth$1" >> $outfile
else