~njansson/dolfin/hpc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# notinuse
#
# Scan subdirectories for files that may not be in use,
# that is, old files that should be removed.
#
# This script should be run from the top level directory.
                                                                                                    
# Simple test to see where we are
# FIXME: Does not work when typing ./scripts/...
CHECK=`echo $0 | cut -d'/' -f1`
if [ "$CHECK" != "scripts" ]; then
        echo "This script must be run from the top level directory."
        exit 1
fi

for f in `find . -name '*.h' -printf '%f '`; do
	a=`rgrep $f * | grep include`
	if [ "x$a" == "x" ]; then
		echo File $f may not be used.
	fi
done