🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #33844

Re: need a script for pruning a new ACTIVE file

#33844
From: Matthew Malthouse
Date: Wed, 16 Dec 1998 00:00
41 lines
2083 bytes
On 13 Dec 1998 23:58:10 GMT Charles Wilkins wrote:
} Hi,
} I am using inn-1.7.2
} 
} I am also using /usr/lib/news/bin getlist -h hostname > active to pull down
} a peer's active file.
} I want to prune all of the entries of this file down to this format:
} groupname 0000000000 0000000001 y
} 
} Here is a script that I found that doesnt work for me. It is supposed to
} convert the contents of a file by the name of upstream.active into your
} starting active file. On my system it just empties the contents of the
} active file.
} 
} cat upstream.active | awk 'amp;#123; printf("%s 0000000000 0000000001
} %s\n", $1 $4) amp;#125;' > active
} 
} Any comments or suggestions would be greatly appreciated!

The following Perl script (written by a colleague) does the job for me.

Take out the comment marks at the begining of each line of course. :)
#  #!/usr/bin/perl
#	open(ACTIVE, "active") ; 
#	while (<ACTIVE>) {
#	        ($name, $hi, $lo, $flag) = split ;
#	        open(NEWACTIVE, ">>miktest") ;
#	        print NEWACTIVE "$name 0000000000 0000000001 $flag\n" ;
#	        close(NEWACTIVE) ;
#	}

Hope it's what you want. The new file is called 'miktest' but you could 
change that or do as I do, copy active to active.bak and mikect to active

Matthew
-- 
And on the seventh day, He exited from append mode.
 
http://www.calmeilles.demon.co.uk 

Technical Details
Message-ID: <slrn77g1f6.6jk.matthew.malthouse@special.guardian.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <01be26eb$905963e0$2b6e60cf@the-helm.pcscs.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn77g1f6.6jk.matthew.malthouse@special.guardian.co.uk>
Subject: Re: need a script for pruning a new ACTIVE file
Date: Wed, 16 Dec 1998 00:00:00 +0000
From: matthew.malthouse@guardian.co.uk (Matthew Malthouse)
References: <01be26eb$905963e0$2b6e60cf@the-helm.pcscs.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 422952959
Distribution: inet
Organization: Guardian Newspapers Ltd, London
Reply-To: matthew.malthouse@guardian.co.uk
Newsgroups: news.software.nntp