Re: Diffs from CVS keyword expansion
- From
Randal L. Schwartz <merlyn@stonehenge.com>
- Date
- Dec 5, 2006, 19:45 UTC
- Message-ID
- <86k616m8i9.fsf@blue.stonehenge.com>
- In-Reply-To
- <20061205121443.GB2428@cepheus>
>>>>> "Uwe" == Uwe Kleine-Koenig <zeisberg@informatik.uni-freiburg.de> writes:
Uwe> #! /bin/sh Uwe> exec perl -i -p -e 's/\$(Id|Revision):.*?\$/\$$1: \$/' "$@";
Ow. My eyes hurt from that. How about we rewrite that as a native Perl script:
#!/usr/bin/perl
$^I = ""; # this is -i
while (<>) {
s/\$(Id|Revision):.*?\$/\$$1: \$/;
print;
}-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.