From owner-freebsd-doc@FreeBSD.ORG Mon Jun 16 12:00:31 2003 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34D3737B401 for ; Mon, 16 Jun 2003 12:00:31 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 972D743F85 for ; Mon, 16 Jun 2003 12:00:30 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5GJ0UUp041560 for ; Mon, 16 Jun 2003 12:00:30 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5GJ0Um4041559; Mon, 16 Jun 2003 12:00:30 -0700 (PDT) Date: Mon, 16 Jun 2003 12:00:30 -0700 (PDT) Message-Id: <200306161900.h5GJ0Um4041559@freefall.freebsd.org> To: freebsd-doc@FreeBSD.org From: Lukas Ertl Subject: Re: docs/53315: [PATCH] remove extraneous whitespace at the end of lines in articles X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Lukas Ertl List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 19:00:31 -0000 The following reply was made to PR docs/53315; it has been noted by GNATS. From: Lukas Ertl To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-doc@FreeBSD.org Cc: Lukas Ertl Subject: Re: docs/53315: [PATCH] remove extraneous whitespace at the end of lines in articles Date: Mon, 16 Jun 2003 20:59:38 +0200 (CEST) On Sat, 14 Jun 2003 FreeBSD-gnats-submit@FreeBSD.org wrote: > >Category: docs > >Responsible: freebsd-doc > >Synopsis: [PATCH] remove extraneous whitespace at the end of lines= in articles > >Arrival-Date: Sat Jun 14 05:50:11 PDT 2003 Ok, I see that a 200k+-sized patch isn't really appreciated. :-) The following Perl script does the same job. Call it "cleanspaces" or whatever and run it like "cleanspaces *.sgml". ---8<--- #!/usr/bin/perl -w use strict; for my $file (@ARGV) { my $dont_touch =3D 0; my $bak =3D "$file.bak"; open IN, "<$file" or die $!; open OUT, ">$bak" or die $!; while () { if (m!|
|<\!--||]+>!) =
 {
             $dont_touch =3D 1;
         }
         if (m!|
|-->||!) { $dont_touch =3D 0; } s/\s+$/\n/ unless $dont_touch; print OUT $_; } close IN; close OUT; rename ($bak, $file) or die $!; } ---8<--- regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/