Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # 2004/08/22 K. Piche Find missing library references.
- # 2015/11/27 orbea Refreshed script
- ifs=$IFS
- IFS=':'
- ARCH=$(uname -m)
- libdirs="/lib:/usr/lib:/usr/X11R6/lib:/usr/libexec:/usr/$ARCH-slackware-linux:/lib64:/usr/lib64:/usr/X11R6/lib64"
- extras=
- # Check ELF binaries in the PATH and specified dir trees.
- for tree in $PATH $libdirs $extras
- do
- echo DIR $tree
- # Get list of files in tree.
- files=$(find $tree -type f)
- IFS=$ifs
- for i in $files
- do
- if [ `file $i | grep -c 'ELF'` -ne 0 ]; then
- # Is an ELF binary.
- if [ `ldd $i 2>/dev/null | grep -c 'not found'` -ne 0 ]; then
- # Missing lib.
- echo "$i:"
- ldd $i 2>/dev/null | grep 'not found'
- fi
- fi
- done
- done
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement