#!/bin/bash # Checks all shared libariries on the system, if they link to # a given library. # # $1 = Library, which will be tested for # for directory in /usr/lib /usr/local/lib do for library in ${directory}/*.so* do if [ -f "${library}" ] && [ ! -h "${library}" ]; then ldd ${library} | grep ${1} > /dev/null if [ ${?} -eq 0 ]; then echo "${library} links against ${1}"; fi fi done done