🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #74214

Re: Renaming a newsgroup

#74214
From: Jeffrey M. Vinocur
Date: Sun, 10 Sep 2006 13:39
61 lines
3129 bytes
In article <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net>,
John F. Morse <xanadu.bbs@invalid.net> wrote:
>Looking at Russ's "INN 2.x FAQ" Section 6.5 "Rename a newsgroup"
>
>But before I execute it, I have a feeling that I need to supply the 
>names of the groups on which I want to work.

*laugh*  I generally don't write scripts where you have to edit
the source code to make it work!

If you run the script with no arguments, it will give you usage
information.  (The usage information is that the first
commandline argument is the old group name, the second
commandline argument is the new group name, and all the others
are the files you want to modify.  So something like
`renamer.pl test test1 *` would probably do it.)


>Where in these two lines do I change the variables to "test" and "test1":
>
>    my ($src, $dst) = (shift, shift);
>    die "Usage: $0 oldgroup newgroup [file1 [file2 ...]]\n"
>        unless(defined $dst);
>
>
>Would they be "oldgroup" and "newgroup" becoming "test" and "test1"?

This is just the line that prints out the usage information I was
alluding to above.  But it's $src and $dst that are the two
variables used in the rest of the script.  "oldgroup" and
"newgroup" are just pieces of text being used in the usage info.
You could change them to "archaicgroup" etc without altering
anything.


>die "Usage: $0 test test1 [file1 [file2 ...]]\n"
>
>What is the "shift, shift" for?

That gets the commandline arguments.  Try `perldoc -f shift`.


>And what are the optional [file 1 [file2 ...]] labels?

Those are the news articles on disk you want to modify.


>Finally, what could I do if I wanted to rename the header info in both 
>local.announce and local.test (local.*)?
>
>Or in ~/articles/* if these multiple directory changes are even 
>possible? If not, I would be required to run the Perl script from within 
>each directory in ~/articles ?

Er, you'd just run the script one time per move, with the
appropriate commandline arguments.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Technical Details
Message-ID: <ee14j8$c6a$1@puck.litech.org>
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!postnews.google.com!news4.google.com!news.glorb.com!news.litech.org!not-for-mail
References: <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net>

Show Full Headers
Complete Article Headers
Message-ID: <ee14j8$c6a$1@puck.litech.org>
Subject: Re: Renaming a newsgroup
Date: Sun, 10 Sep 2006 13:39:52 +0000
From: jeff@litech.org (Jeffrey M. Vinocur)
References: <AiTMg.17827$QM6.1566@bgtnsc05-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!postnews.google.com!news4.google.com!news.glorb.com!news.litech.org!not-for-mail
Newsgroups: news.software.nntp
Organization: Litech Systems Design
Lines: 61
Sender: jeff@litech.org
NNTP-Posting-Host: puck.litech.org
X-Trace: puck.litech.org 1157895592 12490 66.218.0.75 (10 Sep 2006 13:39:52
 GMT)
X-Complaints-To: usenet@litech.org
NNTP-Posting-Date: Sun, 10 Sep 2006 13:39:52 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: jeff@litech.org (Jeffrey M. Vinocur)