File:  [mozdev] / annozilla / src / unused-entities.sh
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Oct 14 19:53:50 2008 UTC (9 years ago) by matthew
Branches: MAIN
CVS tags: HEAD, ANNOZILLA-0-7-0
Script to check for unused entities

#!/bin/bash

# Sample usage: ./unused-entities.sh locale/en-US/annozilla/ content/

echo "Unused entities:"

for dtdfile in `ls $1*.dtd`
do
	awk '/<!ENTITY/ {print $2}' < $dtdfile | while read line
	do
		search=`grep -R "${line}" "$2"`
		if [ "$search" == "" ]
		then
			echo "${line}";
		fi
	done;
done;

echo ""
echo "Unused properties:"

for propfile in `ls $1*.properties`
do
	awk -F "=" '{if (!($2 == "")) { print $1 }}' < $propfile | while read line
	do
		search=`grep -R "${line}" "$2"`
		if [ "$search" == "" ]
		then
			echo "${line}";
		fi
	done;
done;


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>