🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #74225

Re: Renaming a newsgroup

#74225
From: John F. Morse
Date: Mon, 11 Sep 2006 15:25
37 lines
2205 bytes
Dr.Ruud wrote:

>John F. Morse schreef:
>
>  
>
>>#!/usr/bin/perl -wi
>>my ($src, $dst) = (shift, shift);
>>die "Usage: $0 oldgroup newgroup [file1 [file2 ...]]\n"
>>    unless(defined $dst);
>>while(<>) {
>>    s/$src/$dst/g if 1 .. /^$/ and /^(Newsgroups|Followup-To|Xref):/i;
>>    
>>
>
>If $src can contain regex-special characters like .?*+{[^$@
>then change that substitution to
>
>     s/\Q$src/$dst/g
>
>The \Q will quote all non-word-characters, see perlre and perlop and
>quotemeta().
>


I presume you include the period (the first character, just before the ? 
mark above)? My eyes aren't that good -- maybe it is a comma?

If it is a period, I have successfully renamed groups from 
local.announcement and local.test to xanadu.announce and xanadu.test 
using Jeff's "s/$src/$dst/g" example.

I don't pretend to know anything about Perl (wish I did), but I just 
wanted to let you know of my test results.

-- 
John
Technical Details
Message-ID: <IdfNg.106807$5i3.64730@bgtnsc04-news.ops.worldnet.att.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
References: <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net> <ee42fj.188.1@news.isolution.nl>

Show Full Headers
Complete Article Headers
Message-ID: <IdfNg.106807$5i3.64730@bgtnsc04-news.ops.worldnet.att.net>
Subject: Re: Renaming a newsgroup
Date: Mon, 11 Sep 2006 15:25:29 GMT
From: "John F. Morse" <xanadu.bbs@invalid.net>
References: <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net> <ee42fj.188.1@news.isolution.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
Reply-To: xanadu.bbs@invalid.net
Organization: Xanadu BBS
User-Agent: Debian Thunderbird 1.0.2 (X11/20060423)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: news.software.nntp
In-Reply-To: <ee42fj.188.1@news.isolution.nl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 37
NNTP-Posting-Host: acb8c0bd6896f08e6aad8b0bd14017a2
X-Complaints-To: abuse@worldnet.att.net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1157988328
NNTP-Posting-Date: Mon, 11 Sep 2006 15:25:28 GMT