[Logcheck-devel] Remove trailing whitespace (Patch)

Thomas Güttler guettli at thomas-guettler.de
Tue Jan 10 20:28:52 UTC 2006


Hi,

I wasted some time because there was a space character at the end of
an ignore line. I wrote a small patch which removes all whitespace
at the end of all ignore lines.

Patch is attached.

 Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: niemand.leermann at thomas-guettler.de

-------------- next part --------------
--- logcheck_1.2.42	2006-01-10 21:08:40.000000000 +0100
+++ logcheck	2006-01-10 21:18:06.000000000 +0100
@@ -212,8 +212,9 @@
 	    if [ -f ${dir}/${rulefile} ]; then
 		debug "cleanrules: ${dir}/${rulefile}"
 		# pipe to cat on greps to get usable exit status
-		egrep --text -v '^[[:space:]]*$|^#' $dir/$rulefile | cat \
-		    >> $cleaned/$rulefile \
+		# Remove trailing whitespace
+		egrep --text -v '^[[:space:]]*$|^#' $dir/$rulefile | sed -re 's/^(.+[^ ]) +$/\1/' | \
+		    cat >> $cleaned/$rulefile \
 		    || error "Couldn't append to $cleaned/$rulefile. Disk Full?"
 	    fi
 	done


More information about the Logcheck-devel mailing list