X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fbuildor%2Ffind_in_code.sh;h=721aa2bd89fa2cfba13dc2402bfd3e5f3297d00a;hb=4b556222c8773f2d0e5f044e1dca167392de04e4;hp=ed9cb859a11ef042b27a06e8e946298d56df2138;hpb=ac49e578588b52bdf35dfb906b0b07f4a9abcf4c;p=feisty_meow.git diff --git a/scripts/buildor/find_in_code.sh b/scripts/buildor/find_in_code.sh index ed9cb859..721aa2bd 100644 --- a/scripts/buildor/find_in_code.sh +++ b/scripts/buildor/find_in_code.sh @@ -1,4 +1,22 @@ #!/bin/bash seek="$1"; shift +if [ -z "$seek" ]; then + echo This script needs a pattern to look for in the current directory. + echo All code files here and in subdirectories will be searched for the + echo pattern. + exit 1 +fi -find . -type f -exec echo "\"{}\"" ';' | grep -v '.svn' | grep -v '.git' | grep -v '.exe' | grep -v '.obj' | grep -v '.class' | grep -v '.dll' | grep -v '.lib' | xargs grep -li "$seek" +find . -type f \( -iname "*" \ + ! -iname "*.svn" \ + ! -iname "*.git" \ + ! -iname "*.exe" \ + ! -iname "*.obj" \ + ! -iname "*.class" \ + ! -iname "*.dll" \ + ! -iname "*.lib" \ + ! -iname "*.jar" \ + ! -iname "*.zip" \ + ! -iname "*.tar" \ + ! -iname "*.gz" \) \ + -exec echo "\"{}\"" ';' | xargs grep -li "$seek"