From owner-freebsd-questions@FreeBSD.ORG Fri Dec 5 10:31:50 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CB8A106564A for ; Fri, 5 Dec 2008 10:31:50 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB818FC0A for ; Fri, 5 Dec 2008 10:31:50 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 78740AFBC02; Fri, 5 Dec 2008 01:31:49 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org, mcoyles@horbury.wakefield.sch.uk Date: Fri, 5 Dec 2008 11:31:46 +0100 User-Agent: KMail/1.9.7 References: <002b01c95609$ed0c7200$c7255600$@wakefield.sch.uk> <004e01c956c0$27f97820$77ec6860$@wakefield.sch.uk> <005901c956c2$e90e4340$bb2ac9c0$@wakefield.sch.uk> In-Reply-To: <005901c956c2$e90e4340$bb2ac9c0$@wakefield.sch.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812051131.47577.fbsd.questions@rachie.is-a-geek.net> Cc: Subject: Re: Mass find/replace... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 10:31:50 -0000 On Friday 05 December 2008 11:19:09 Marc Coyles wrote: > > All done n' dusted now - thanks very much for everyone's input...! > > Have noted everything down in the back of my copy of "Absolute > > FreeBSD 2nd Edition" (which has inherited quite a few additional > > pages since I bought it). > > > > Now that that's done, I can start to wander thru logs and find > > who/how... > > > > Cheers! > > Marc > > Arse - I spoke too soon. > > Anyone know any perl to remove blank lines???! > It's left a blank line at top of each PHP file that it performed the action > on, which has broken things a touch... 's/^(.*?)\r?\n\r?\n/$1\n/s' should only replace the first empty line it finds in a file and accounts for windows line endings. Try it out on one file first: perl -pi.bak 's/^(.*?)\r?\n\r?\n/$1\n/s' filename.php -- Mel Problem with today's modular software: they start with the modules and never get to the software part.