File:  [CSRG BSD Unix] / 43BSDTahoe / new / news / src / rmgroup.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:58 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43tahoe
BSD 4.3tahoe

: '@(#)rmgroup.sh	1.8	12/16/86'
for group
do
	qgrp="`echo $group | sed 's/\./\\\./g'`"
	if
		grep -s "^$qgrp " LIBDIR/active
	then
		echo "Removing newsgroup $group"
		echo "/^$qgrp[ 	]/d" >>/tmp/,edit$$
		dir=SPOOLDIR/"`echo $group | sed 's/\./\//g'`"
		if test  -d $dir
		then
			rm $dir/* >/dev/null 2>&1
			echo "rmdir $dir >/dev/null 2>&1" >>/tmp/,rmdir$$
		else
			echo "$0: $dir: no spool directory" 2>&1
		fi
	else
		echo "$0: $group: no such newsgroup" 2>&1
	fi
done
echo w >>/tmp/,edit$$
echo q >>/tmp/,edit$$
echo "Editing LIBDIR/active..."
ed - LIBDIR/active < /tmp/,edit$$
FIXACTIVE
echo "Editing LIBDIR/newsgroups..."
ed - LIBDIR/newsgroups < /tmp/,edit$$
echo "Removing directories..."
if test -s /tmp/,rmdir$$
then
	sort +1r -o /tmp/,rmdir$$ /tmp/,rmdir$$
	. /tmp/,rmdir$$
fi
rm -f /tmp/,edit$$ /tmp/,rmdir$$
exit 0

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.