Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site tekgds.UUCP Path: utzoo!linus!decvax!tektronix!tekgds!charliep From: charliep@tekgds.UUCP (Charles E. Perkins) Newsgroups: net.news.b Subject: Re: Destructive N Command -- Wishlist Message-ID: <1502@tekgds.UUCP> Date: Thu, 27-Oct-83 01:10:50 EDT Article-I.D.: tekgds.1502 Posted: Thu Oct 27 01:10:50 1983 Date-Received: Sun, 23-Oct-83 12:34:22 EDT References: <2239@alice.UUCP> <138@apollo.UUCP> Organization: Tektronix, Beaverton OR Lines: 49 ----------- I put together a script called "resetnews" that takes newsgroups as parameters and tries to do a slightly more efficient job at ignoring unread news than does "readnews -p > /dev/null". If no parameters are given it updates your NEWSRC file to ignore unread news in ALL newsgroups. I do not claim that it is bulletproof, just that it has worked for me. It is written for news2.10, but a trivial modification will make it work for news2.9 as well. Charles Perkins PS. I thought it was to short to post to net.sources. PPS. Yeah, it would be nice to do this inside "readnews" and "vnews". ____________________________________________________________________ active=/usr/lib/news/active if test $# = 0 then set `cat $active | sed s/\ .*//` fi cd $HOME newsrc=`echo ${NEWSRC-"$HOME"/.newsrc}` cp $newsrc /tmp/newsrc1$$ for groupname in $* do groupdir=`echo $groupname | tr '.' '/'` if test -d /usr/spool/news/$groupdir then hibound=`grep $groupname $active | sed "s/.*\ 0*//"` hibound=`echo $hibound | sed "s/\ .*//"` if test -n $hibound then sed "s/^\($groupname.\)\ .*/\1 1-$hibound/" < /tmp/newsrc1$$ > /tmp/newsrc2$$ mv /tmp/newsrc2$$ /tmp/newsrc1$$ else echo $groupname is not in $active! fi else echo $groupdir does not exist! fi done if test -f $newsrc then oldnewsrc=$HOME/old.`basename $newsrc` mv $newsrc $oldnewsrc echo "The file $oldnewsrc contains your old $newsrc file." fi mv /tmp/newsrc1$$ $newsrc