Created
July 7, 2021 09:02
-
-
Save rm77/1d48d91e74c1ae8069847eb1973fe9c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#by greg minshall | |
needs=`readelf -d $1 | \ | |
awk '$2=="(NEEDED)" { | |
gsub("[][]", "", $5); | |
hits[$5]=$5 | |
} | |
END { | |
for (i in hits) { | |
printf(sprintf("%s ", i)) | |
} | |
}'` | |
ldconfig -p | \ | |
awk -vneeds="$needs" \ | |
'BEGIN{ | |
split(needs,aneeds) | |
} | |
{ | |
if (!arr[$1]) | |
arr[$1] = $NF | |
} | |
END { | |
for (i in aneeds) { | |
need = aneeds[i]; | |
if (arr[need]) { | |
print need "\t" arr[need] | |
} else { | |
print "unfulfilled:", need | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment