#!/bin/sh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#    ngp <pat> <file>...        (Nm+Grep+Print)                           #
# Run nm on all the files, feeding the namelist to "grep <pat>".  For any #
# files that match, print the filename and the matching lines.  Note that #
# this works for both .o and .a files.                                    #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
if [ $# -lt 2 ];then echo Usage: $0 file pattern ; exit 1; fi
#echo Call: $0 $*
p="$1"
shift
for f
do	(nm $f | grep "$p" > /dev/null) && {
		echo $f:
		nm $f | grep "$p"
	}
done
