🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #285

scanning mailbox with sed

#285
From: Tony Porczyk
Date: Tue, 04 Aug 1992 14:53
21 lines
987 bytes
To the sed users - I am trying to have a simple sed script scan
the mailbox and output only messages that contain certain keywords.
I have RTFM'd, but something is still escaping me.  I match the message
multiline space okay, but seem only to be able to print the matched
line, not the whole message.  I invoke sed with "-n" option.  Here is
the script:

/^From\ .*[1-2][0-9][0-9][0-9]$/,/!^From\.*[1-2][0-9][0-9][0-9]$/
{
        N
        /pattern/p
}

I tried probably about 20 different ways of putting commands inside
the braces, the above is a simplified version, none of them worked.
I am sure it is dog gone simple, and I am simply not seeing it...

Thanks,

Tony
Technical Details
Message-ID: <lvvmbq+.messina@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!decwrl!csus.edu!netcomsv!netcom.com!messina

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!decwrl!csus.edu!netcomsv!netcom.com!messina
From: messina@netcom.com (Tony Porczyk)
Newsgroups: comp.unix.shell
Subject: scanning mailbox with sed
Message-ID: <lvvmbq+.messina@netcom.com>
Date: 4 Aug 92 14:53:56 GMT
Organization: Messina Software
Lines: 21