in reply to Extracting Pattern Match from log

This grabs anything between < and > on a line with 450 in it, and print it. I'm not sure if this is what you want to do.
cat /var/log/mail/info | perl -n -e 'print $1, $/ if /450 <([^>]*)>/'
Boris

Replies are listed 'Best First'.
Re: Re: Extracting Pattern Match from log
by b10m (Vicar) on Jan 28, 2004 at 11:51 UTC

    Ladies and gentlemen, we have a new nominee for the Useless Use of Cat Award ! ;)

    This would do exactly the same, yet without abusing cat:

    perl -n -e 'print $1, $/ if /450 <([^>]*)>/' /var/log/mail/info
    --
    b10m

    All code is usually tested, but rarely trusted.