From owner-freebsd-doc@FreeBSD.ORG Mon Jun 16 11:59:55 2003 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CF2637B401; Mon, 16 Jun 2003 11:59:55 -0700 (PDT) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id D637543FA3; Mon, 16 Jun 2003 11:59:53 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from [10.0.0.2] (adslle.cc.univie.ac.at [131.130.102.11]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h5GIxdon259920; Mon, 16 Jun 2003 20:59:44 +0200 Date: Mon, 16 Jun 2003 20:59:38 +0200 (CEST) From: Lukas Ertl To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-doc@FreeBSD.org In-Reply-To: <200306141250.h5ECoBGZ043143@freefall.freebsd.org> Message-ID: <20030616205705.H550@korben.in.tern> References: <200306141250.h5ECoBGZ043143@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: mx1 4251; Body=0 Fuz1=0 Fuz2=0 cc: 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 List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 18:59:55 -0000 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/