Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsrgv.UUCP Path: utzoo!utcsrgv!dave From: dave@utcsrgv.UUCP (Dave Sherman) Newsgroups: net.news,net.sources Subject: nprint - script for batch-printing articles in sensible order Message-ID: <439@utcsrgv.UUCP> Date: Thu, 8-Nov-84 23:10:40 EST Article-I.D.: utcsrgv.439 Posted: Thu Nov 8 23:10:40 1984 Date-Received: Fri, 9-Nov-84 13:06:11 EST Distribution: net Organization: The Law Society of Upper Canada, Toronto Lines: 42 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