3 if [ -z "$seek" ]; then
4 echo This script needs a pattern to look for in the current directory.
5 echo All non-binary files here and in subdirectories will be searched for the
7 echo A directory can be passed as an optional second parameter, which will
8 echo cause the search to occur in that directory instead.
11 #hmmm: might be nice to support multiple directories...
12 # just need to pass them to find as an array maybe?
14 if [ -z "$dir" ]; then
18 #hmmm: we need to encode this useful logic as a list of binary file endings.
19 find "$dir" -type f \( -iname "*" \
47 ! -iname "*.svn-base" \
53 -exec echo "\"{}\"" ';' | xargs grep -li --binary-files=without-match -- "$seek" | grep -v "^\.[^\/]\|\/\."
55 # first grep looks in every valid file for the pattern requested.
56 # second grep strains out dot files.
57 #hmmm: why are we doing that second step?