``rmgroup'' shell script to aid in hand removal of newsgroups
chris at eneevax.UUCP
chris at eneevax.UUCP
Tue Jun 5 23:29:19 AEST 1984
Here's a handy shell script for manually removing newsgroups.
---------------------tear at dashed lines--------------------
#! /bin/sh
#
# @(#)rmgroup.sh (U of Maryland) FLB 28-Jun-1983
# Bug fixes 5 June 1984 Chris Torek
#
# Delete a newsgroup
lib=/usr/lib/news
spool=/usr/spool/news
for group
do
qgrp="`echo $group | sed 's/\./\\\./g'`"
if
grep -s "^$qgrp [0-9][0-9][0-9][0-9][0-9]$" $lib/active
then
ed - $lib/active << xxxFOOxxx
/^$qgrp [0-9][0-9][0-9][0-9][0-9]$/d
w
q
xxxFOOxxx
dir=$spool/"`echo $group | sed 's/\./\//g'`"
if
[ -d "$dir" ]
then
rm -r "$dir"
else
echo "$0: $dir: no spool directory" 2>&1
fi
else
echo "$0: $group: no such newsgroup" 2>&1
fi
done
exit 0
---------------------tear at dashed lines--------------------
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris at maryland
More information about the Comp.sources.unix
mailing list