Means of trimming files

Bill Moran wmoran at potentialtech.com
Tue Jun 29 10:07:25 PDT 2004


Gerard Samuel <fbsd-questions at 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


More information about the freebsd-questions mailing list