nice change to do proper iname processing in find command.
[feisty_meow.git] / scripts / buildor / find_in_code.sh
1 #!/bin/bash
2 seek="$1"; shift
3 if [ -z "$seek" ]; then
4   echo This script needs a pattern to look for in the current directory.
5   echo All code files here and in subdirectories will be searched for the
6   echo pattern.
7   exit 1
8 fi
9
10 find . -type f \( -iname "*" \
11   ! -iname "*.svn" \
12   ! -iname "*.git" \
13   ! -iname "*.exe" \
14   ! -iname "*.obj" \
15   ! -iname "*.class" \
16   ! -iname "*.dll" \
17   ! -iname "*.lib" \
18   ! -iname "*.jar" \
19   ! -iname "*.zip" \
20   ! -iname "*.tar" \
21   ! -iname "*.gz" \) \
22   -exec echo "\"{}\"" ';' | xargs grep -li "$seek"