Created
February 6, 2024 05:00
-
-
Save fathonix/0ec0e83e1584c4fda02a2d7f6637478f to your computer and use it in GitHub Desktop.
Print filename that contains the specified symbol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# findsym.sh - Print filename that contains the specified symbol | |
# Usage: findsym.sh [symbol] [file ...] | |
# Licensed under MIT. (c) 2024 Aldo Adirajasa Fathoni | |
findsym() { | |
for f in ${@:2}; do | |
found=$(nm -a "$f" | \grep $1) | |
if [ $? -eq 0 ]; then | |
echo ${f}: | |
echo $found | |
fi | |
done | |
} | |
findsym $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment