Subject: Re: library dependencies ?
To: Space Case <wormey@eskimo.com>
From: None <collver@linuxfreemail.com>
List: current-users
Date: 06/02/2001 17:05:02
On Sat, Jun 02, 2001 at 04:13:02PM -0700, Space Case wrote:
> Hi.
> 
> Does anyone have/know of a tool that can check the library dependencies of
> executables, and flag those whose libraries are missing?
> 
> Reason is, I have cleaned out the excess minor versions of the shared libs,
> but some of them have several excess major versions, and I'd like to get
> rid of those, too.
> 
> Example:
>   libcurses.so.2.5  <- wanna go away
>   libcurses.so.3.5  <- gone
>   libcurses.so.3.6  <- gone
>   libcurses.so.3.7  <- wanna go away
>   libcurses.so.4.0  <- gone
>   libcurses.so.4.1  <- gone
>   libcurses.so.4.2  <- keeper
> What depends on 2.5 or 3.7?

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

Ben
-- 
NetBSD: because it is there