Re: Diffs from CVS keyword expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tisdag 05 december 2006 20:55 skrev Junio C Hamano:
> merlyn@xxxxxxxxxxxxxx (Randal L. Schwartz) writes:
> >>>>>> "Uwe" == Uwe Kleine-Koenig <zeisberg@xxxxxxxxxxxxxxxxxxxxxxxxxx>
> >>>>>> 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 ;-).
May I suggest a compromise? : 

#!/usr/bin/perl -i -p
s/\$(Id|Revision):.*?\$/\$$1: \$/;

-- robin
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]