On Tue, 29 Jun 2004 19:50:25 -0400, Bill Moran <[EMAIL PROTECTED]> wrote:
> 
> Gerard Samuel <[EMAIL PROTECTED]> wrote:
> 
> > find ./ -name '*.php' -exec php -r '$f = file_get_contents("{}"); $h =
> > fopen("{}", "wb"); fwrite($h, trim($f)); fclose($h);' \;
> >
> > It did the job perfectly.

$ perl -0 -pi -e 's/\n+$//s' *.php

will edit each .php file and replace it too. If you want a backup, then

$ perl -0 -p -i.bak -e 's/\n+$//s' *.php

Cheers
Gautam
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to