Guest User

Untitled

a guest
Nov 28th, 2015
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. # 2004/08/22 K. Piche Find missing library references.
  3. # 2015/11/27 orbea Refreshed script
  4.  
  5. ifs=$IFS
  6. IFS=':'
  7.  
  8. ARCH=$(uname -m)
  9.  
  10. libdirs="/lib:/usr/lib:/usr/X11R6/lib:/usr/libexec:/usr/$ARCH-slackware-linux:/lib64:/usr/lib64:/usr/X11R6/lib64"
  11. extras=
  12.  
  13. # Check ELF binaries in the PATH and specified dir trees.
  14. for tree in $PATH $libdirs $extras
  15. do
  16. echo DIR $tree
  17.  
  18. # Get list of files in tree.
  19. files=$(find $tree -type f)
  20. IFS=$ifs
  21. for i in $files
  22. do
  23. if [ `file $i | grep -c 'ELF'` -ne 0 ]; then
  24. # Is an ELF binary.
  25. if [ `ldd $i 2>/dev/null | grep -c 'not found'` -ne 0 ]; then
  26. # Missing lib.
  27. echo "$i:"
  28. ldd $i 2>/dev/null | grep 'not found'
  29. fi
  30. fi
  31. done
  32. done
  33.  
  34. exit
RAW Paste Data