view miscellany/tools/8limit @ 0:bce86c4163a3

Initial revision
author kono
date Mon, 18 Apr 2005 23:46:02 +0900
parents
children
line wrap: on
line source

: Check names differ over first 8 chars
:	Steven Pemberton, CWI, Amsterdam, steven@mcvax
case $# in
0) echo Usage: $0 object-files ... ; exit 1;;
*) ;;
esac

trap 'rm -f /tmp/lim1.$$ /tmp/lim2.$$; exit 1' 1 2 15
for f
do
   nm $f | sed "s/^...........//" | grep "^_" | sed "s/^_//" >/tmp/lim1.$$
   sed "s/^\(........\).*/\1/" </tmp/lim1.$$ | uniq -d | sed "s/.*/grep \"^&\" \/tmp\/lim1.$$/" >/tmp/lim2.$$
   if test -s /tmp/lim2.$$
   then
	echo $f:
	sh /tmp/lim2.$$
   fi
done
rm -f /tmp/lim1.$$ /tmp/lim2.$$