Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!epiwrl!epimass!jbuck
From: jbuck@epimass.UUCP (Joe Buck)
Newsgroups: comp.os.eunice,news.software.b
Subject: rmgroup doesn't work with Eunice; here's a fix
Message-ID: <721@epimass.UUCP>
Date: Fri, 12-Dec-86 18:34:39 EST
Article-I.D.: epimass.721
Posted: Fri Dec 12 18:34:39 1986
Date-Received: Mon, 15-Dec-86 20:53:22 EST
Organization: Entropic Processing, Inc., Cupertino, CA
Lines: 40
Xref: mnetor comp.os.eunice:1 news.software.b:100

Eunice does not support the '[' synonym for test (and you can't
name a file '[' on Eunice in any case).  Furthermore, ed writes a
file out in VMS format instead of Unix format, so we must invoke
vmstounix on "active" once we're done.  Here's a revised version.

------------------------------------------------------------------------------
: '@(#)rmgroup.sh (from 1.6; modified for Eunice 12/12/86, epimass!jbuck)'
for group
do
	echo "Removing newsgroup $group"
	qgrp="`echo $group | sed 's/\./\\\./g'`"
	if
		grep -s "^$qgrp " /usr/lib/news/active
	then
		cat << E_O_F >/tmp/$$
/^$qgrp[ 	]/d
w
q
E_O_F
		ed - /usr/lib/news/active < /tmp/$$
		ed - /usr/lib/news/newsgroups < /tmp/$$
		dir=/usr/spool/news/"`echo $group | sed 's/\./\//g'`"
		if test -d $dir
		then
			rm $dir/*
			rmdir $dir
		else
			echo "$0: $dir: no spool directory" 2>&1
		fi
	else
		echo "$0: $group: no such newsgroup" 2>&1
	fi
done
rm -f /tmp/$$
/etc/vmstounix /usr/lib/news/active
exit 0
------------------------------------------------------------------------------
-- 
- Joe Buck 	{hplabs,ihnp4,sun}!oliveb!epimass!jbuck		HASA (A,S)
  Entropic Processing, Inc., Cupertino, California