slight cleanup, also new script for checking files for obscenities, which has already
[feisty_meow.git] / scripts / text / obscenity_check.sh
diff --git a/scripts/text/obscenity_check.sh b/scripts/text/obscenity_check.sh
new file mode 100644 (file)
index 0000000..09cf095
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# this script looks for any files containing offensive language, but one must
+# fill out the list of inappropriate language to censor.  this list is stored
+# in a file in the user's home folder called ".badlanguage".
+# given the bad word list (with one obscenity word per line), this will find
+# any files that have those words in them and print them out.
+
+OBSCENITY_FILE="$HOME/.badlanguage"
+
+if [ ! -f "$OBSCENITY_FILE" ]; then
+  echo "This script requires a file with obscenities at: $OBSCENITY_FILE"
+  echo "The file should contain all obscene words that you wish to locate"
+  echo "in your files.  Each obscene word should be listed one per line in"
+  echo "the bad word file."
+  exit 1
+fi
+
+# replace the line feeds with a grep pipe.
+obscene_line="$(echo $(cat $OBSCENITY_FILE) | sed -e 's/  */\\|/g')" 
+#echo "obscenities: $obscene_line"
+
+bash "$FEISTY_MEOW_SCRIPTS/buildor/search_code.sh" "$obscene_line" $*
+