#! /bin/sh

LIB=$1
SPATH=$2

for EXECUTABLE in `find "${SPATH}" -perm '-111' -exec file {} \; \
		| grep ELF.*dynamically\ linked | cut -d ':' -f 1`; do
	ldd "${EXECUTABLE}" | fgrep "${LIB}" >/dev/null;
	if [ $? -eq 0 ]; then
		echo ${EXECUTABLE}
	fi
done
