#!/bin/bash

# Bash script for finding library file that contains a function or a class.
# Usage: findlib <library folder> <function/class name>

libs="$(ls $1/*.so)"
for lib in $libs; do
   list="$(nm -D $lib)" 
   if [ "${list/$2}" != "$list" ]; then
      echo $lib $2
   fi
done
