Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sunny
From: sunny@sun.uucp (Sunny Kirsten)
Newsgroups: net.news.group
Subject: Re: Table of contents for news
Message-ID: <1789@sun.uucp>
Date: Mon, 12-Nov-84 23:20:38 EST
Article-I.D.: sun.1789
Posted: Mon Nov 12 23:20:38 1984
Date-Received: Wed, 14-Nov-84 05:29:06 EST
Organization: Sun Microsystems, Inc.
Lines: 71

>is there anyway to get [...] a "Table of Contents" for news?<

: This is a shar archive.  Extract with sh, not csh.
: The rest of this file will extract:
: ns
echo extracting - ns
sed 's/^X//' > ns << '/*EOF'
X#! /bin/sh
X#	ns [-a] newsgroups ...
X#	List subject headings of articles in listed newsgroups
X#	starting at last-read article in .newsrc.
X#	With the -a flag all articles are listed.
X#	Author : Oscar Nierstrasz @ utcsrgv!oscar
Xcase $# in
X0 )	echo 'Usage: ns [-a]  ...' 1>&2
X	exit ;;
Xesac
Xnrc=$HOME/.newsrc
Xif test ! -r $nrc
Xthen
X	echo "ns : Can't find $nrc" 1>&2
X	exit
Xfi
Xn=/usr/spool/news
Xs='/^Subject:/ { print FILENAME ": " $0 ; exit }'
Xcase $1 in
X-a )	all=y
X	shift ;;
X* )	all=n ;;
Xesac
Xfor i
Xdo
X	d=`echo $i | sed "s/\./\//g"`
X	if test ! -d $n/$d
X	then
X		echo "$i : no such newsgroup" 1>&2
X	else
X		cd $n/$d
X		echo
X		echo "--- $i : $n/$d ----"
X		echo
X		case $all in
X		y )	f=all ;;
X		n )	f=`sed -n "/^$i:/s/.*-//p" $nrc`
X			case $f in
X			"" )	f=all ;;
X			* )	if test ! -r $f
X				then
X					f=all
X				fi ;;
X			esac ;;
X		esac
X		case $f in
X		all )	for j in *
X			do
X				awk "$s" $j
X			done ;;
X		* )	while test -r $f
X			do
X				awk "$s" $f
X				f=`expr $f + 1`
X			done ;;
X		esac
X	fi
Xdone
/*EOF
exit
-- 
mail ucbvax\!sun\!sunny decvax\!sun\!sunny ihnp4\!sun\!sunny<