From owner-freebsd-questions@FreeBSD.ORG Tue Jun 29 19:15:43 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 7ABC116A4CE for ; Tue, 29 Jun 2004 19:15:43 +0000 (GMT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3738143D39 for ; Tue, 29 Jun 2004 19:15:43 +0000 (GMT) (envelope-from fbsd-questions@trini0.org) Received: from hivemind.trini0.org (trini0.org[65.34.205.195]) by comcast.net (sccrmhc13) with ESMTP id <20040629191530016002ah0te>; Tue, 29 Jun 2004 19:15:30 +0000 Received: from gladiator.trini0.org (gladiator.trini0.org [192.168.0.3]) by hivemind.trini0.org (Postfix) with ESMTP id BD3AF16C; Tue, 29 Jun 2004 15:15:29 -0400 (EDT) From: Gerard Samuel To: freebsd-questions@freebsd.org Date: Tue, 29 Jun 2004 15:15:29 -0400 User-Agent: KMail/1.6.2 References: <200406291301.36285.fbsd-questions@trini0.org> <20040629130702.4116ec60.wmoran@potentialtech.com> In-Reply-To: <20040629130702.4116ec60.wmoran@potentialtech.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406291515.29580.fbsd-questions@trini0.org> 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 19:15:43 -0000 On Tuesday 29 June 2004 01:07 pm, Bill Moran wrote: > Gerard Samuel wrote: > > When editing php files, via the command line, there is a newline > > character after the closing ?> > > Im looking for a command that would trim files, so that I can append it > > to the find command. > > > > find ./ -name '*.php' -exec SOME_COMMAND {} \; > > If you're absolutely sure of the number of characters you're removing from > the end of the file, you could use truncate(1). > > Otherwise, you'll probably want sed or perl to check that it's not removing > important characters. Thanks. I'll see what I can come up with...