a better name.
authorChris Koeritz <fred@gruntose.com>
Fri, 8 Nov 2013 02:50:37 +0000 (21:50 -0500)
committerChris Koeritz <fred@gruntose.com>
Fri, 8 Nov 2013 02:50:37 +0000 (21:50 -0500)
scripts/buildor/search_code.sh [deleted file]
scripts/text/search_text.sh [new file with mode: 0644]

diff --git a/scripts/buildor/search_code.sh b/scripts/buildor/search_code.sh
deleted file mode 100644 (file)
index 9aed077..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/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
-#hmmm: might be nice to support multiple directories...
-#      just need to pass them to find as an array maybe?
-dir="$1"; shift
-if [ -z "$dir" ]; then
-  dir=.
-fi
-
-#hmmm: we need to encode this useful logic as a list of binary file endings.
-find "$dir" -type f \( -iname "*" \
-  ! -iname "*~" \
-  ! -iname "*.bin" \
-  ! -iname "*.bz2" \
-  ! -iname "*.class" \
-  ! -iname "*.dll" \
-  ! -iname "*.deb" \
-  ! -iname "*.dmg" \
-  ! -iname "*.exe" \
-  ! -iname "entries" \
-  ! -iname "*.git" \
-  ! -iname "*.gz" \
-  ! -iname "*.iar" \
-  ! -iname "*.jar" \
-  ! -iname "*.lib" \
-  ! -iname "*.ncb" \
-  ! -iname "*.oar" \
-  ! -iname "*.obj" \
-  ! -iname "*.pch" \
-  ! -iname "*.png" \
-  ! -iname "*.snarf" \
-  ! -iname "*.so" \
-  ! -iname "*.so.2" \
-  ! -iname "*.svn" \
-  ! -iname "*.svn-base" \
-  ! -iname "*.tar" \
-  ! -iname "*.tmp" \
-  ! -iname "*.zip" \) \
-  -exec echo "\"{}\"" ';' | xargs grep -li "$seek" | grep -v "^\.[^\/]\|\/\."
-
-
diff --git a/scripts/text/search_text.sh b/scripts/text/search_text.sh
new file mode 100644 (file)
index 0000000..e88c58d
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+seek="$1"; shift
+if [ -z "$seek" ]; then
+  echo This script needs a pattern to look for in the current directory.
+  echo All non-binary files here and in subdirectories will be searched for the
+  echo pattern.
+  echo A directory can be passed as an optional second parameter, which will
+  echo cause the search to occur in that directory instead.
+  exit 1
+fi
+#hmmm: might be nice to support multiple directories...
+#      just need to pass them to find as an array maybe?
+dir="$1"; shift
+if [ -z "$dir" ]; then
+  dir=.
+fi
+
+#hmmm: we need to encode this useful logic as a list of binary file endings.
+find "$dir" -type f \( -iname "*" \
+  ! -iname "*~" \
+  ! -iname "*.bin" \
+  ! -iname "*.bz2" \
+  ! -iname "*.class" \
+  ! -iname "*.dll" \
+  ! -iname "*.deb" \
+  ! -iname "*.dmg" \
+  ! -iname "*.exe" \
+  ! -iname "entries" \
+  ! -iname "*.git" \
+  ! -iname "*.gz" \
+  ! -iname "*.iar" \
+  ! -iname "*.jar" \
+  ! -iname "*.lib" \
+  ! -iname "*.ncb" \
+  ! -iname "*.oar" \
+  ! -iname "*.obj" \
+  ! -iname "*.pch" \
+  ! -iname "*.png" \
+  ! -iname "*.snarf" \
+  ! -iname "*.so" \
+  ! -iname "*.so.2" \
+  ! -iname "*.svn" \
+  ! -iname "*.svn-base" \
+  ! -iname "*.tar" \
+  ! -iname "*.tmp" \
+  ! -iname "*.zip" \) \
+  -exec echo "\"{}\"" ';' | xargs grep -li "$seek" | grep -v "^\.[^\/]\|\/\."
+
+