:
#! /bin/sh
#   A quickie to find pathnames of articles from the history file matching
#   egrep patterns (from command args).
#
#   The sed commands:
#	/\t$/d
#		get rid of lines ending with tab (i.e., expired articles)
#	s/.*[ \t]\(.*\) $/\1/
#		get last newsgroup and local number ("net.unix-wizards/728")
#	s/\./\//g
#		translate dots to slashes:
#		net.unix-wizards/728 -> net/unix-wizards/728
#	s;^;$SPOOLDIR/;p
#		prepend "/usr/spool/news/"
#		net/unix-wizards/728 -> /usr/spool/news/net/unix-wizards/728
PATH=/bin:/usr/bin
LIBDIR=/usr/lib/news
SPOOLDIR=/usr/spool/news
egrep $* $LIBDIR/history |
    sed -n -e '/	$/d' -e 's/.*[ 	]\(.*\) $/\1/' \
	-e 's/\./\//g' -e "s;^;$SPOOLDIR/;p"
