🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Heiko W.Rupp Wed, 15 May 1996 00:00
Changes to INN FAQ Part part5/9: part5
#7645
Author: 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 !!

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads