Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site Glacier.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!Glacier!reid
From: reid@Glacier.ARPA (Brian Reid)
Newsgroups: net.news.sa
Subject: Find out what your feeds are doing, or your users
Message-ID: <12132@Glacier.ARPA>
Date: Tue, 24-Sep-85 03:39:11 EDT
Article-I.D.: Glacier.12132
Posted: Tue Sep 24 03:39:11 1985
Date-Received: Wed, 25-Sep-85 03:30:17 EDT
Reply-To: reid@Glacier.UUCP (Brian Reid)
Organization: Stanford University, Computer Systems Lab
Lines: 34
Summary: Silly little shell script to snoop in news

#! /bin/sh
# find all news from a given site (and person)
# If you don't have bmgrep (fast Boyer-Moore fgrep) then just use fgrep
#
# Brian Reid, Mon Sep 23 23:55:49 1985
GREP=bmgrep
PAGER=/usr/ucb/more
PATH=/usr/local/bin:/usr/stanford/bin:/usr/ucb:/usr/bin/:/bin
NEWSDIR=/usr/lib/news
NEWSPOOL=/usr/spool/news
#######################################################
SITE=${1-1111}
PERSON=${2-0000}
if [ "$SITE" -eq "1111" ]; then
    echo Usage: newsfrom host \[ user \] 
    exit 1
fi
trap "rm -f /tmp/newsfrom.$$ /tmp/newsfr.$$" 0 1 2 15

$GREP "@${SITE}." $NEWSDIR/history | awk '{print $5}' | \
	sed -e 's,\.,/,g' -e 's,^,'"$NEWSPOOL/," > /tmp/newsfrom.$$
if [ "$PERSON" != "0000" ]; then
    egrep -l 'From:.*'"$PERSON" `cat /tmp/newsfrom.$$` > /tmp/newsfr.$$
    mv /tmp/newsfr.$$ /tmp/newsfrom.$$
fi
if [ -s /tmp/newsfrom.$$ ]; then
    $PAGER `cat /tmp/newsfrom.$$`
else
    echo No news from $1 $2
fi
# end of "newsfrom" script
-- 
	Brian Reid	decwrl!glacier!reid
	Stanford	reid@SU-Glacier.ARPA