🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by jungjun LEE Thu, 19 Sep 1996 00:00
How can i remove groups with wildcard?
#11017
Author: jungjun LEE
Date: Thu, 19 Sep 1996 00:00
9 lines
739 bytes
i want to remove groups with wildcard
for example..
ctlinnd rmgroup vmsnet.*

is there any script for that?
thank..

Re: How can i remove groups with wildcard?
#11012
Author: James Brister
Date: Thu, 19 Sep 1996 00:00
16 lines
1110 bytes
"jungjun LEE" <lee@hist.co.kr> writes:

> i want to remove groups with wildcard
> for example..
> ctlinnd rmgroup vmsnet.*

If you're doing mass deletion or creation of groups, you're best off
throttling the server and editing the active file with vi.

James
-- 
James Brister                                            brister@vix.com
Internet Software Consortium                             inn@isc.org

Re: How can i remove groups with wildcard?
#11036
Author: John Milburn
Date: Fri, 20 Sep 1996 00:00
57 lines
2065 bytes
[Bogus inet distribution removed. Email to original poster.]

James Brister <brister@vix.com> writes:
>"jungjun LEE" <lee@hist.co.kr> writes:

>> i want to remove groups with wildcard
>> for example..
>> ctlinnd rmgroup vmsnet.*

>If you're doing mass deletion or creation of groups, you're best off
>throttling the server and editing the active file with vi.

More specifically (since the original questioner is a local user), use
something like the following script.  Error checking should be added,
for thos who need it. :) You must run this as user news, and must ensure
that innd is already running.

Sorry James, I couldn't see any clear way to make a cute single line
perl monstrosity out of this.

-jem
John Milburn          Pohang, Korea         jem@xpat.com
"I'm afraid I'm not personally qualified to confuse cats." -Python

#!/bin/sh
#
# Accepts an egrep style regex, and removes matches from the
# active file.
#
# John Milburn - jem@xpat.com - 96.9.20

prog=`basename $0`
numargs=$#
if [ $numargs -ne 1 ] ; then
	echo ${prog}: usage \`$prog regex\`
	exit 1
fi
regexp=$1

. /var/news/lib/innshellvars

CTLINND=${NEWSBIN}/ctlinnd

${CTLINND} throttle 'removing groups'

${EGREP} -v ${regexp} ${ACTIVE} >${NEWACTIVE}

mv ${ACTIVE} ${OLDACTIVE}
mv ${NEWACTIVE} ${ACTIVE}

${CTLINND} reload active update
${CTLINND} go 'removing groups'

exit 0

Re: How can i remove groups with wildcard?
#11049
Author: James Brister
Date: Sat, 21 Sep 1996 00:00
33 lines
1606 bytes
jem@xpat.com (John Milburn) writes:

> Sorry James, I couldn't see any clear way to make a cute single line
> perl monstrosity out of this.

Now there's a challenge I can't refuse...

The following (not too throughly tested, and I cheat a bit). It will do
multiple patterns at once too.

Left readably formatted, but still legal (if you run a bash-like shell).

perl -e 'die unless @ARGV;
open(P,". /var/news/etc/innshellvars ; set|");
while(<P>){$c="$1/ctlinnd" if /^NEWSBIN=(.*)/;
$a=$1 if /^ACTIVE=(.*)/;
$oa=$1 if /^OLDACTIVE=(.*)/;
$na=$1 if /^NEWACTIVE=(.*)/;}
print "$ctlinnd throttle removing groups;\n";
open(A,"<$a")||die;
open(NA,">$na")||die;
$re=join ("|",@ARGV) ;
while(<A>){print NA unless /^${ARGV[0]/;}
close(A);close(NA);`mv $a $oa && mv $na $a ; $c go removing groups`
' alt.binaries.* rec.food.*

James
-- 
James Brister                                            brister@vix.com
Internet Software Consortium                             inn@isc.org

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads