Subject: Re: library dependencies ?
To: Space Case <wormey@eskimo.com>
From: None <collver@linuxfreemail.com>
List: current-users
Date: 06/02/2001 17:51:03
On Sat, Jun 02, 2001 at 05:32:42PM -0700, Space Case wrote:
> On Jun 2, 5:05pm, collver@linuxfreemail.com wrote:
> >On Sat, Jun 02, 2001 at 04:13:02PM -0700, Space Case wrote:
> >> Does anyone have/know of a tool that can check the library dependencies of
> >> executables, and flag those whose libraries are missing?
>
> >if you use ksh or bash, you could do something like:
> >
> >find $(echo $PATH|tr : ' ') | while read f; do ldd "$f" 2>/dev/null |\
> > grep 'curses\.so\.[23]' 2>&1 >/dev/null; \
> > if [ $? -eq 0 ]; then echo $f; fi; done
>
> Oh, I rather like that. Now I just have to decide whether I want to run
> it for each of the 22 libs that have old majors, or try to shoehorn it all
> into the one grep command. ;-)
shoehorning example with manageable syntax:
find $(echo $PATH|tr : ' ') |\
while read f
do
ldd "$f" 2>/dev/null |
grep \
-e 'curses\.so\.[23]' \
-e 'blessings\.so\.7' \
-e 'iberty\.so\.1' \
2>&1 >/dev/null
if [ $? -eq 0 ]
then
echo $f
fi
done
Ben
--
NetBSD: because it is there