[Logwatch-Devel] Solaris patch for scripts/shared/removeheaders

Mike Tremaine mgt at stellarcore.net
Mon Sep 26 11:31:49 MST 2005

On Tue, 2005-09-20 at 17:45, David Baldwin wrote:
> Wasn't working properly on Solaris. All these regexps could easily be collapsed 
> into 1 or 2. Also not sure why there are parentheses around ([^ ]*) in each line 
> - back reference is never used.
> David.

I don't remember why the () was there but it was probably in use long
ago. This one has obviously grown one line at a time as needed which is
why it's a little ugly now.

What wasn't working under Solaris [and what release?] just wondering.

How about something like this

while (defined($ThisLine = <STDIN>)) {
    #First line is Solaris ID tag style -mgt
    $ThisLine =~ s/^... .. ..:..:.. [^ ]* [^ ]*(\[\d*\])?: \[ID \d+( \w+\.\w+\)?] //;
    $ThisLine =~ s/^... .. ..:..:.. [^ ]* [^ ]*(\[\d*\])?: //;
    print $ThisLine;

Anyone want to test that and see if it works? I'm just about out time
for this today might be able to spend some more later.

Mike Tremaine
mgt at stellarcore.net

More information about the Logwatch-Devel mailing list