Re: [SCRIPT] chomp: trim trailing whitespace
- From
- Jan Engelhardt <jengelh@linux01.gwdg.de>
- Date
- May 27, 2006, 12:42 UTC
- Message-ID
- <Pine.LNX.4.61.0605271441080.4857@yvahk01.tjqt.qr>
- In-Reply-To
- <447838EB.9060900@garzik.org>
Show 8 quoted lines
>> Pretty long script. How about this two-liner? It does not show 'bytes >> chomped' but it also trims trailing whitespace. >> >> #!/usr/bin/perl -i -p >> s/[ \t\r\n]+$// > > Yes, it does, but a bit too aggressive for what we need :) >
Whoops, should have been s/[ \t\r]+$// And the CL form is perl -i -pe '...'
Somehow, you can't group it to -ipe, but who cares.
Jan Engelhardt