I'm struggling with the right command to do the following:
find all shared libraries (*.so) that contain a certain symbol.
This is what I've tried:
find -iname '*.so*' -exec nm {} \; | grep -H _ZN6QDebugD1Ev
The above gives some output with symbols found, but doesn't pinpoint the filename that the symbol occurred in. Any flag that I give to grep to tell it to print a filename is lost because grep is being fed from stdin.
(standard input): U _ZN6QDebugD1Ev
(standard input): U _ZN6QDebugD1Ev
(standard input): U _ZN6QDebugD1Ev
(standard input): U _ZN6QDebugD1Ev
(standard input):0015e928 T _ZN6QDebugD1Ev
(standard input): U _ZN6QDebugD1Ev
(standard input): U _ZN6QDebugD1Ev
(standard input): U _ZN6QDebugD1Ev
Another attempt:
find -iname '*.so*' -exec nm {} \; -exec grep _ZN6QDebugD1Ev {} \;
This doesn't work because the two execs are completely independent.
What should I do?