Created
September 26, 2017 13:44
-
-
Save mortie/045f5b7748bf3ed491fbb4b054df6f92 to your computer and use it in GitHub Desktop.
List all .so dependencies recursively
This file contains hidden or 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
#!/bin/bash | |
list="" | |
lsd() { | |
if echo "$list" | grep -F "$1" >/dev/null; then | |
return | |
fi | |
list=$(printf "%s\n%s" "$list" "$1") | |
echo "$1" | |
text=$(ldd "$1" | grep -F '=>') | |
while read -r dep; do | |
d=$(echo "$dep" | cut -d'=' -f2 | cut -d' ' -f2) | |
lsd "$d" | |
done <<< "$text" | |
} | |
for a in "$@"; do | |
lsd "$a" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment