🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #7645

Changes to INN FAQ Part part5/9: part5

#7645
From: Heiko W.Rupp
Date: Wed, 15 May 1996 00:00
44 lines
1827 bytes
--- part5	1996/05/07 16:07:00	2.9
+++ part5	1996/05/13 06:22:52
@@ -390,29 +390,14 @@
 2. awk '{printf "%s %.10d %.10d %s\n", $1, $2, $3, $4}' active > active.new
 
 if your awk printf spaves instead of leading zeroes in this step,
-then try the following instead of step 2: (or do all awk's pad with
-spaces here?)
+then try the following instead of step 2: 
 
-perl /tmp/foo < active > active.new
+awk '{printf "%s %010d %010d %s\n", $1, $2, $3, $4}' active > active.new
 
----------- /tmp/foo
-#!/usr/local/bin/perl
+or
 
-while(<>) {
-	chop;
-	($nam,$lo,$hi,$mode)=split;
-	$f=length($lo);
-	for ($i=0;$i<10-$f;$i++) {
-		$lo = "0".$lo;
-	}
-	$f=length($hi);
-	for ($i=0;$i<10-$f;$i++) {
-		$hi = "0".$hi;
-	}
-	
-	printf("%s %s %s %s\n",$nam,$lo,$hi,$mode);
-}
------------  (If someone has an easier way, then please tell me)
+perl -ne 'split;printf "%s %.10d %.10d %s\n", $_[0], $_[1], $_[2], $_[3];' 
+		active > active.new
 
 3. mv active.new active
 4. ctlinnd reload active updated
-- 
Heiko W.Rupp hwr@pilhuhn.de
INN FAQ can be found in ftp://ftp.xlink.net/pub/news/docs/
                   Stoppt den Kinderwahnsinn !! -- Esst nur deutsche Kinder !!

Technical Details
Message-ID: <diff.faq.p5_832151278@pilhuhn.de>
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

Show Full Headers
Complete Article Headers
Message-ID: <diff.faq.p5_832151278@pilhuhn.de>
Subject: Changes to INN FAQ Part part5/9: part5
Date: Wed, 15 May 1996 00:00:00 +0000
From: hwr@pilhuhn.de (Heiko W.Rupp)
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: 154906111
Supersedes: <diff.faq.p5_831485169@pilhuhn.de>
Followup-to: news.software.nntp
Organization: The Home Of The Pilhuhn
Newsgroups: news.software.nntp,news.software.b