rn as a batch process, again

Blair P. Houghton bph at buengc.BU.EDU
Sun Dec 17 09:31:32 AEST 1989


In article <611 at dftsrv.gsfc.nasa.gov> packer at chrpserv.gsfc.nasa.gov (Charles Packer) writes:
>I would like to run "rn" as a batch process to get all the
>messages from selected newsgroups into a file or files
>so that I can FTP them over to the VAX, a programming 
>environment in which I am more at home.

You're much better off using a sh(1) script that uses find(1)
to collect the articles for you.

#! /bin/sh
while read group
do
    groupdir=/usr/spool/news/`echo $group | tr . /`
    find $groupdir -mtime 1 -exec cat {} \; > /usr/tmp/outfile.$group
done < $HOME/.copygroups

where .copygroups is a file in your home directory containing
the names of the groups you are interested in one per line like so:

comp.unix.questions
rec.arts.startrek
alt.flame
comp.os.vms

et cetera; this is much less information than is in a .newsrc file.

All of the articles written into the group's directory within the past
day will be concatenated and placed in a file in the current directory
with a name like "outfile.comp.unix.questions".  You can change the form
of this name without hurting anything, of course.

Note to the experts:  I know it can be made a one-liner, but who cares?

				--Blair
				  "And who'd type it into the
				   command line?"



More information about the Comp.unix.questions mailing list