Skip to content

Instantly share code, notes, and snippets.

@proditis
Created November 6, 2019 14:20
Show Gist options
  • Save proditis/5d27b6be16e16796ae185e4bdc711f5b to your computer and use it in GitHub Desktop.
Save proditis/5d27b6be16e16796ae185e4bdc711f5b to your computer and use it in GitHub Desktop.
Scan a file for linked libraries recursively and generate list of distinct libs needed in a chroot
#!/bin/ksh
libslist=$(ldd $1|grep rlib|awk '{print $NF}')
echo $1>paths.lst
for i in $libslist;do
echo $i
ldd $i|grep rlib|awk '{print $NF}'
done|sort -u >>paths.lst
cat paths.lst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment