Monday, 2 February 2009

Shell Script or perl help. to write sections of a log to a tmp file for mailing - LinuxQuestions.org

I came across an issue recently where I needed to copy a whole section of lines from a log file into a daily report.
I devised some script to get line numbers and work what lines my section starts and finishes on then uses tail and head to get this text.

Then some bright spark said try this sed code, and its works great.

Thanks blackhole64!


sed -n \"/^Rule Summary:/,/^Total violations found:/p\"

No comments:

Post a Comment