new file for running a large report on a folder hierarchy using
authorChris Koeritz <fred@gruntose.com>
Sat, 18 Feb 2012 15:49:30 +0000 (10:49 -0500)
committerChris Koeritz <fred@gruntose.com>
Sat, 18 Feb 2012 15:49:30 +0000 (10:49 -0500)
checker tool.

scripts/files/checker_report.sh [new file with mode: 0755]

diff --git a/scripts/files/checker_report.sh b/scripts/files/checker_report.sh
new file mode 100755 (executable)
index 0000000..ce0bb6b
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# checker_report: runs the checker utility against all files in a directory,
+# in such a way that the file count can be very high without blowing its
+# mind, and without any extra headers in the report.
+
+source $FEISTY_MEOW_SCRIPTS/core/functions.sh
+
+dirname="$1"; shift
+outfile="$1"; shift  # optional parm.
+
+if [ -z "$dirname" ]; then
+  echo "This script requires one directory on which to make a checker report."
+  exit 1
+fi
+
+if [ -z "$outfile" ]; then
+  outfile="$HOME/checker_report_$(hostname)_$(date_stringer).txt"
+fi
+
+if [ -f "$outfile" ]; then
+  rm "$outfile"
+fi
+
+temp_file_list="$(mktemp /tmp/file_list_temporary.XXXXXX)"
+
+find "$dirname" -type f >"$temp_file_list"
+###-exec echo \"{}\" ';' 
+while read line; do
+  checker -q -b "$line" 2>&1 >>"$outfile"
+done <"$temp_file_list"
+
+