[net.sources] nprint - script for batch-printing articles in sensible order

dave@utcsrgv.UUCP (Dave Sherman) (11/09/84)

If you'd like to print out a bunch of articles in a newsgroup
(i.e., "readnews -xp | lpr"), but would like to see them in logical
order, use the script below. NOTE: as it stands, it will print
all articles in the newsgroup. If you just want to see recent
articles, you'll have to patch it by hand. Articles are sorted
by "Subject" header, chronologically within each topic.

I call it "nprint". Invoke it with "nprint net.foo", and pipe to lpr
if you like.

Dave Sherman
Toronto

(cut below this line)
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#! /bin/sh
# nprint - print all articles in newsgroup $1, in logical order

if test $# != 1; then echo "usage: nprint newsgroup"; exit 1; fi

cd /usr/spool/news/`echo $1 ^ tr . /`

echo '(ignore any messages like "?: No such file or directory")' > /dev/tty


echo "
++++++++++++++++++++++++++++++++++++++++
Articles in newsgroup $1
++++++++++++++++++++++++++++++++++++++++
"
for i in `grep "^Subject:" ? ?? ??? ????  | \
	sed -e 's/Re: //' -e 's/Re: //' -e 's/Re: //' | \
	sort -bfd +1 | \
	sed 's/:.*//'`
do
	echo ==================================================
	echo Article $i
	echo ==================================================
	cat $i
done
-- 
 { allegra cornell decvax ihnp4 linus utzoo }!utcsrgv!dave