[Ovirt-devel] Re: a pox on whitespace

Steve Linabery slinabery at redhat.com
Thu Jul 24 01:32:30 UTC 2008


On Wed, Jul 23, 2008 at 11:55:32PM +0200, Alan Pevec wrote:
>>> Also needed might be a quick script to remove trailing whitespace from
>>> a file?
>>
>> perl -pi -e 's/\s+$//' file1 file2 ...
>
> Oopps! That ate all linefeeds, use this one instead:
>
> perl -pi.bak -e 's/[ \t]+$//' file1 file2 ...
>
> _______________________________________________
> Ovirt-devel mailing list
> Ovirt-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/ovirt-devel

I thought I'd mention to my fellow emacs users how easy it is to sanitize your current buffer...
M-< to the start of the buffer.
M-x replace-regexp the expression '[[:space:]]+$' with ''.

-Steve




More information about the ovirt-devel mailing list