From owner-freebsd-questions@FreeBSD.ORG Tue Jun 29 23:50:27 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6746116A4CE for ; Tue, 29 Jun 2004 23:50:27 +0000 (GMT) Received: from internet.potentialtech.com (h-66-167-251-6.phlapafg.covad.net [66.167.251.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AB2843D49 for ; Tue, 29 Jun 2004 23:50:27 +0000 (GMT) (envelope-from wmoran@potentialtech.com) Received: from working.potentialtech.com (pa-plum-cmts1e-68-68-113-64.pittpa.adelphia.net [68.68.113.64]) by internet.potentialtech.com (Postfix) with ESMTP id 3B09E69A39; Tue, 29 Jun 2004 19:50:26 -0400 (EDT) Date: Tue, 29 Jun 2004 19:50:25 -0400 From: Bill Moran To: Gerard Samuel Message-Id: <20040629195025.549fe8f3.wmoran@potentialtech.com> In-Reply-To: <200406291646.28811.fbsd-questions@trini0.org> References: <200406292005.i5TK5nZ18158@clunix.cl.msu.edu> <200406291621.22848.fbsd-questions@trini0.org> <200406291646.28811.fbsd-questions@trini0.org> Organization: Potential Technologies X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: jerrymc@clunix.cl.msu.edu cc: freebsd-questions@freebsd.org Subject: Re: Means of trimming files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jun 2004 23:50:27 -0000 Gerard Samuel wrote: > On Tuesday 29 June 2004 04:21 pm, Gerard Samuel wrote: > > So Ill start using truncate() for now, and start investigating perl. > > Thanks.... > > > > As I was writing the previous email, I thought about combining find with php's > cli interface and came up with this "dirty" command (all in one line) -> > > find ./ -name '*.php' -exec php -r '$f = file_get_contents("{}"); $h = > fopen("{}", "wb"); fwrite($h, trim($f)); fclose($h);' \; > > It did the job perfectly. Now _that's_ using the tools ... and the tools you know to boot! -- Bill Moran Potential Technologies http://www.potentialtech.com