Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jun 2004 13:07:02 -0400
From:      Bill Moran <wmoran@potentialtech.com>
To:        Gerard Samuel <fbsd-questions@trini0.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Means of trimming files
Message-ID:  <20040629130702.4116ec60.wmoran@potentialtech.com>
In-Reply-To: <200406291301.36285.fbsd-questions@trini0.org>
References:  <200406291301.36285.fbsd-questions@trini0.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Gerard Samuel <fbsd-questions@trini0.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040629130702.4116ec60.wmoran>