🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1461

Parsing a news article with source in it

#1461
From: Bill Poitras
Date: Wed, 10 Oct 1990 13:55
17 lines
1390 bytes
What I am trying to do is pipe a news article through a shell script
(preferable /bin/sh) so that it parses the header, extracts the filename
from the "Archive: ..." line, and then writes the rest of the file,
from the '!# /bin/sh' line to the end to filename specified in the 
"Archive: ..." line.  I can't seem to get the shell script to read up to
the !# /bin/sh using <<.  There are basically two tasks:
	1) Parsing the header, extracting the filename in the Archive line
	2) Writing the rest of the file to the filename gotten from #1

Does such a script exist?  Any help would greatly be appreciated.


+-----------------+---------------------------+-----------------------------+
| Bill Poitras    | Polygen Corporation       | {princeton mit-eddie        |
|     (bill)      | Waltham, MA USA           |  bu sunne}!polygen!bill     |
|                 |                           | bill@polygen.com            |
+-----------------+---------------------------+-----------------------------+
Technical Details
Message-ID: <838@redford.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!rpi!bu.edu!polygen!bill

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!rpi!bu.edu!polygen!bill
From: bill@polygen.uucp (Bill Poitras)
Newsgroups: comp.unix.shell
Subject: Parsing a news article with source in it
Message-ID: <838@redford.UUCP>
Date: 10 Oct 90 13:55:53 GMT
Reply-To: bill@redford.UUCP (Bill Poitras(X258))
Organization: Polygen Corporation, Waltham, MA
Lines: 17