Article View: news.software.nntp
Article #74217Re: Renaming a newsgroup
From: John F. Morse
Date: Sun, 10 Sep 2006 19:20
Date: Sun, 10 Sep 2006 19:20
115 lines
4731 bytes
4731 bytes
Jeffrey M. Vinocur wrote: >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.) > > Sorry about that. ;-) I tried this and it does work. The rest of this message is understood as well. Thanks for pointing out these things. Two more questions.... 1. Where would you suggest I put the Perl script (since news must run this, perhaps pathbin)? Would you run it from within each group's directory to be modified (within the oldgroup or newgroup directory), or does it matter? I tried it from within the newgroup directory, where I also had the renamer.pl script, and it worked. But that requires moving the script, as well as cd to each newgroup directory. (This was actually a two-part question, 1A and 1B.) ;-) 2. Will the script change any occurrence of the oldgroup name should it appear in the body of an article following one of the three header fields in the if statement? I can't see where it is restricted to the header only, but I don't know Perl. >>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. > That is as clear as Rocky Mountain air, now that I've read your explanation and also experimented. It sure went over my head earlier. I also had to apt-get perl-doc and was reading when you posted. I've been up about 24 hours, so I'm going to go rest my eyes, brain and body and start fresh later this evening. Thanks Jeff. -- John
Technical Details
Message-ID:
<RzZMg.99175$5i3.82988@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!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mailReferences:
<AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net> <ee14j8$c6a$1@puck.litech.org>Show Full Headers
Complete Article Headers
Message-ID: <RzZMg.99175$5i3.82988@bgtnsc04-news.ops.worldnet.att.net> Subject: Re: Renaming a newsgroup Date: Sun, 10 Sep 2006 19:20:17 GMT From: "John F. Morse" <xanadu.bbs@invalid.net> References: <AiTMg.17827$QM6.1566@bgtnsc05-news.ops.worldnet.att.net> <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!wn14feed!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: <ee14j8$c6a$1@puck.litech.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 115 NNTP-Posting-Host: cdb161912ddd55a1f3916704718d2a19 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1157916017 NNTP-Posting-Date: Sun, 10 Sep 2006 19:20:17 GMT