Article View: news.software.readers
Article #1437Re: How to save specific header line with 'rn' ?
From: Andrew Hilborne
Date: Thu, 09 Apr 1992 11:37
Date: Thu, 09 Apr 1992 11:37
55 lines
2445 bytes
2445 bytes
In <j8lrq04@fido.asd.sgi.com> pdc@lunch.wpd.sgi.com (Paul Close) discusses
how to save articles in rn without including all the header lines. He suggests
using the following:
>In RNINIT (or the file RNINIT points to):
> -EMBOXSAVER='$HOME/bin/mysaver %X/mbox.saver %A %P %c %a %B %C "%b" "From %T %`date`"'
> -ENORMSAVER='$HOME/bin/mysaver %X/norm.saver %A %P %c %a %B %C "%b"'
>
>In $HOME/bin/mysaver:
>-----------------------cut here-------------------------
>#!/bin/sh
>
>saver=$1
>file=$2
>shift; shift
>
>cat $file |
> sed -e '/^Path: /d' -e '/^Message-ID: /d' -e '/^Path: /d' |
> $saver "" "$@"
>-----------------------cut here-------------------------
I am certainly pleased because I have the impression that NORMSAVER
is now working when rn is compiled to use NNTP. At one time
NORMSAVER stopped working when NNTP support was compiled in.
Paul Close goes on to say:
>There you have it! One note: the sed line will remove *any* lines that
>begin with Path:, etc. There's no way for sed to know if the Path: line
>is part of the header or message body.
This isn't true. The following sed script will delete all except the From:
Subject: and Date: lines. It won't delete anything after the first
blank line:
sed -n -e ': top
/^From: / {
p; n; b top
}
/^Date: / {
p; n; b top
}
/^Subject: / {
p; n; b top
}
/^$/ {
p; n; b bot
}
n; b top
: bot
p; n; b bot
'
--
Andrew Hilborne
Technical Details
Message-ID:
<1992Apr9.113755.3604@newcastle.ac.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!sparky!uunet!mcsun!uknet!newcastle.ac.uk!newton!namhReferences:
<1992Apr6.213356.7296@ccu.umanitoba.ca> <JIK.92Apr7104517@pit-manager.mit.edu> <j8lrq04@fido.asd.sgi.com>Show Full Headers
Complete Article Headers
Message-ID: <1992Apr9.113755.3604@newcastle.ac.uk> Subject: Re: How to save specific header line with 'rn' ? Date: Thu, 09 Apr 1992 11:37:55 +0000 From: Andrew.Hilborne@newcastle.ac.uk (Andrew Hilborne) References: <1992Apr6.213356.7296@ccu.umanitoba.ca> <JIK.92Apr7104517@pit-manager.mit.edu> <j8lrq04@fido.asd.sgi.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!sparky!uunet!mcsun!uknet!newcastle.ac.uk!newton!namh Newsgroups: news.software.readers Organization: University of Newcastle upon Tyne, UK, NE1 7RU Lines: 55 Nntp-Posting-Host: newton