CentOS Wiki
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • FrontPage
  • Documentation
  • TipsAndTricks
  • HowTos
  • FAQ
  • Events
  • Contribute
  • ReportBugs
  • RecentChanges
  • attachment:CVSHEAD.pl of WikiSandBox

Attachment 'CVSHEAD.pl'

Download

   1 #!/usr/bin/perl -w
   2 #
   3 # Check "CVS-FILES" for "^[whitespace]$Id:" and insert "$Revision", "$Log", "$Date" 
   4 # just after that.
   5 #
   6 # ra@br-online.de 2003-04-29
   7 #
   8 #
   9 
  10 use File::Copy;
  11 
  12 my $line = "";
  13 my $filename = $ARGV[0];
  14 my $tmpfilename = $filename.$$;
  15 copy $filename => $tmpfilename or die "$!";
  16 
  17 open (FILE,"< $tmpfilename");
  18 open (OUTFILE,">$filename");
  19 
  20 while (<FILE>) {
  21 	if ($_ =~ /\$Id:/) {
  22 		print OUTFILE "$_\n\t\$Date\$\n\t\$Revision\$\n\t\$Log\$\n"
  23 	} else {
  24 		print OUTFILE "$_"
  25 	}
  26 }
  27 close(FILE);
  28 close(OUTFILE);
  29 system("rm $tmpfilename");
  30 
  31 	

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-04-01 19:42:58, 0.5 KB) [[attachment:CVSHEAD.pl]]
  • [get | view] (2019-12-09 09:17:15, 10.0 KB) [[attachment:mytest.tdraw]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01