Skip to content

Instantly share code, notes, and snippets.

@YaxuanDai
Created July 3, 2019 12:24
Show Gist options
  • Select an option

  • Save YaxuanDai/caa42e3c719034259e37d5e7b993b0cb to your computer and use it in GitHub Desktop.

Select an option

Save YaxuanDai/caa42e3c719034259e37d5e7b993b0cb to your computer and use it in GitHub Desktop.
Keep calm and find some *.h in a large project.
#!/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
@YaxuanDai
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment