🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #5000

Re: .newsrc Cleanup Program Sought

#5000
From: Tim Pierce
Date: Tue, 20 Jul 1993 07:47
29 lines
1530 bytes
In article <1993Jul19.234609.2029@scic.intel.com>
sbradley@scic.intel.com (Seth J. Bradley) writes:

>A while back, someone posted a .newsrc cleanup program - I believe it was
>a Perl script.

This is the one I use.  I think Peter da Silva contributed the regexp
magic.  A clever sed hacker could probably use the contents of the
"while" loop to rewrite this in sed, too.

#!/usr/local/bin/perl
$HOME = $ENV{HOME};
$NEWSRC = "$HOME/.newsrc";
$TMP = "$HOME/.tmpnewsrc";

open (TMP, ">$TMP");
open (NEWSRC);

while (<NEWSRC>) {
  s/[-,][-,0-9]*[-,]/-/ if /!/;
  print TMP $_;
}

rename ($NEWSRC, "$HOME/.oldnewsrc");
rename ($TMP, $NEWSRC);
-- 
____ Tim Pierce                /        "Oh, it's a *Unix* system!"
\  / twpierce@unix.amherst.edu /  
 \/ (BITnet: TWPIERCE@AMHERST) /            -- Lex, in JURASSIC PARK
Technical Details
Message-ID: <22g7un$4f4@amhux3.amherst.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!darwin.sura.net!sgiblab!eddie.mit.edu!news.mtholyoke.edu!news.amherst.edu!not-for-mail
References: <1993Jul19.234609.2029@scic.intel.com>

Show Full Headers
Complete Article Headers
Message-ID: <22g7un$4f4@amhux3.amherst.edu>
Subject: Re: .newsrc Cleanup Program Sought
Date: Tue, 20 Jul 1993 07:47:35 +0000
From: twpierce@unix.amherst.edu (Tim Pierce)
References: <1993Jul19.234609.2029@scic.intel.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!darwin.sura.net!sgiblab!eddie.mit.edu!news.mtholyoke.edu!news.amherst.edu!not-for-mail
Newsgroups: news.software.readers
Organization: In Absentia
Lines: 29
NNTP-Posting-Host: amhux3.amherst.edu