From 11891e193cc10eb6765bea095e8766c9829ad44a Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 18 Feb 2012 10:49:30 -0500 Subject: [PATCH] new file for running a large report on a folder hierarchy using checker tool. --- scripts/files/checker_report.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 scripts/files/checker_report.sh diff --git a/scripts/files/checker_report.sh b/scripts/files/checker_report.sh new file mode 100755 index 00000000..ce0bb6bd --- /dev/null +++ b/scripts/files/checker_report.sh @@ -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" + + -- 2.34.1