From: Junio C Hamano Date: Tue, 05 Dec 2006 19:55:21 GMT Subject: Re: Diffs from CVS keyword expansion Message-ID: <7v64cqglsm.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <86k616m8i9.fsf@blue.stonehenge.com> merlyn@stonehenge.com (Randal L. Schwartz) writes: >>>>>> "Uwe" == Uwe Kleine-Koenig 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 ;-).