procmail
[Top] [All Lists]

Re: Matching repeating lines?

1997-02-10 22:06:43

-----BEGIN PGP SIGNED MESSAGE-----

        Do you really want to PGP sign every message
        you post to every mailing list?  Do the other
        recipients want to see this?

Lars Kellogg-Stedman <lars(_at_)bu(_dot_)edu> wrote:
:Syslog on some machines is broken, and instead of adding a note to the
:effect of "previous message repeated 271 times", it will include all 271
:seperate log messages.
:
:I don't need to see all of these.
:
:What's the most efficient way of filtering lines that are repeated more
:than <n> times?

If you're willing to settle for n=1, try the "uniq" command (but don't
sort first, as most situations would require).  For more information
and the correct options to use, type at the Unix shell prompt

  man uniq

        Some versions of uniq (notably the GNU one) allow
        a "skip fields" or a "skip characters" feature.

        Given the broken nature of this gentleman's syslogd --
        I hesitated to suggest that -- and offered a script
        which should work even with the oldest awk's.

--
Jim Dennis,                                
info(_at_)mail(_dot_)starshine(_dot_)org
Proprietor,                          
consulting(_at_)mail(_dot_)starshine(_dot_)org
Starshine Technical Services              http://www.starshine.org

<Prev in Thread] Current Thread [Next in Thread>