From owner-freebsd-questions@FreeBSD.ORG Tue Jun 29 17:07:25 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 4136F16A4CE for ; Tue, 29 Jun 2004 17:07:25 +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 C8F9843D31 for ; Tue, 29 Jun 2004 17:07:24 +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 5B7BA69A39; Tue, 29 Jun 2004 13:07:03 -0400 (EDT) Date: Tue, 29 Jun 2004 13:07:02 -0400 From: Bill Moran To: Gerard Samuel Message-Id: <20040629130702.4116ec60.wmoran@potentialtech.com> In-Reply-To: <200406291301.36285.fbsd-questions@trini0.org> References: <200406291301.36285.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: 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 17:07:25 -0000 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. -- Bill Moran Potential Technologies http://www.potentialtech.com