#!/bin/sh
#	ngp <pat> <file>...
# Run nm on all the files, feeding the namelist to "grep <pat>".  For
# any files that match, print the filename and the matching lines.

if [ $# -lt 2 ];then echo Usage: $0 file pattern ; exit 1; fi
p="$1"
shift
for f
do	echo '===> '$f
	(nm $f | grep "$p" > /dev/null) && {
		echo $f:
		nm $f | grep "$p"
	}
done
