2) don't follow symlinks
3) use basename on lib names
CVS patchset: 1182
CVS date: 1996/11/21 22:05:26
# note this works for both a.out and ELF executables
-filelist=$(xargs file -L 2>/dev/null | grep "executable" | cut -d: -f1)
+filelist=$(xargs file 2>/dev/null | grep "executable" | cut -d: -f1)
for f in $filelist; do
- ldd $f | grep -v 'statically linked' | awk '{ print $1 }'
-done | sort -u
+ ldd $f | grep '=>' | awk '{ print $1 }'
+done | sort -u | xargs -r -n 1 basename | sort -u