Article View: news.software.readers
Article #6744Re: "An rn command line for autosaving news"
From: Adri Verhoef
Date: Wed, 01 Dec 1993 17:26
Date: Wed, 01 Dec 1993 17:26
74 lines
2672 bytes
2672 bytes
Subject: Automagically downloading articles via rn
Keywords: rn, UNIX
You want something like this:
% auto-rn this.news.group
The following scripts will help you.
----- cut here ------ BEGIN ----- auto-rn
:
#ident "@(#)auto-rn 1.0 (a3) 15 aug 1992"
if [ $# != 1 ]
then
echo "$0: No newsgroup specified."
exit 1
fi
# If there are no unread articles, rn returns 0 exit status, else 1.
if rn -csq $1
then
echo "No news in group $1."
else
echo "Extracting news from group $1."
KILLGLOBAL=%p/AUTO-RN-KILL rn -M -q -T $1 <<eof
yqq
eof
fi
----- cut here ------ END ----- auto-rn
In the file 'News/AUTO-RN-KILL' (if %p = $HOME/News) you put the following:
----- cut here ------ BEGIN ----- News/AUTO-RN-KILL
/^/s %C:j
----- cut here ------ END ------- News/AUTO-RN-KILL
In this way, articles will be saved in directory $HOME/News, and the
name of the saved file will be that of the newsgroup (%C).
How does 'auto-rn' work?
1) It checks the newsgroup if there are any articles (work to do).
2) It starts 'rn' to read and save the specified newsgroup.
3) It saves each unread article of that newsgroup into the savefile.
4) It marks all read articles as "read" by "junking" each one.
5) It doesn't enter more than one newsgroup per run.
$HOME/News/AUTO-RN-KILL is in fact a rn "KILL" file.
rn -c : check for unread articles
rn -s : suppress initial listing of newsgroups
rn -q : suppress checking for new newsgroups
rn -M : save articles in mailbox format
rn -T : allow typeahead (i.c. "yqq")
Don't reformat the strings "yqq" and "eof" in the 'auto-rn' script.
"yqq" : 'y' for "yes, read this newsgroup"
'q' for "quit this newsgroup at the 'End of group...' prompt"
'q' to leave rn
Note that the following environment variable may come in handy for long
'Path:' headers:
MBOXSAVER=%X/mbox.saver %A %P %c %a %B %C "%b" "From X %`date -u`"
(sh-syntax)
Adri
Technical Details
Message-ID:
<CHD9sE.2A4@rivm.nl>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.notes.mbox.zip!gmd.de!xlink.net!howland.reston.ans.net!pipex!uknet!EU.net!sun4nl!rivm!a3References:
<9311272151.AA18544@aplcomm.jhuapl.edu>Show Full Headers
Complete Article Headers
Message-ID: <CHD9sE.2A4@rivm.nl> Subject: Re: "An rn command line for autosaving news" Date: Wed, 1 Dec 1993 17:26:37 GMT From: a3@rivm.nl (Adri Verhoef) References: <9311272151.AA18544@aplcomm.jhuapl.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.notes.mbox.zip!gmd.de!xlink.net!howland.reston.ans.net!pipex!uknet!EU.net!sun4nl!rivm!a3 Newsgroups: news.software.notes,news.software.readers Sender: news@rivm.nl Organization: Rijksinstituut voor Volksgezondheid en Milieuhygiene,Bilthoven,NL Lines: 73