From owner-freebsd-questions@FreeBSD.ORG Tue Jun 29 20:46:30 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 897C916A4CE for ; Tue, 29 Jun 2004 20:46:30 +0000 (GMT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F5A543D45 for ; Tue, 29 Jun 2004 20:46:30 +0000 (GMT) (envelope-from fbsd-questions@trini0.org) Received: from hivemind.trini0.org (trini0.org[65.34.205.195]) by comcast.net (sccrmhc12) with ESMTP id <2004062920462901200m23jde>; Tue, 29 Jun 2004 20:46:29 +0000 Received: from gladiator.trini0.org (gladiator.trini0.org [192.168.0.3]) by hivemind.trini0.org (Postfix) with ESMTP id DF8B916C; Tue, 29 Jun 2004 16:46:28 -0400 (EDT) From: Gerard Samuel To: freebsd-questions@freebsd.org Date: Tue, 29 Jun 2004 16:46:28 -0400 User-Agent: KMail/1.6.2 References: <200406292005.i5TK5nZ18158@clunix.cl.msu.edu> <200406291621.22848.fbsd-questions@trini0.org> In-Reply-To: <200406291621.22848.fbsd-questions@trini0.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406291646.28811.fbsd-questions@trini0.org> cc: Jerry McAllister cc: Bill Moran 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 20:46:30 -0000 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.