Re: Diffs from CVS keyword expansion
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 5, 2006, 19:55 UTC
- Message-ID
- <7v64cqglsm.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <86k616m8i9.fsf@blue.stonehenge.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
Show 14 quoted lines
>>>>>> "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;
> }That's kinda surprising coming from the resident Perl guru.
I am so used to the command line "-i -p" that I did not even know what $^I does, and I would have lost without your "# this is -i" comment. That alone makes the Uwe's one more readable for me ;-).