key Log In

You are here: wiki.fini > TWiki Web > ManagingTemplates

Start of topic | Skip to actions

Managing Templates

cptmpl runs the following code. This takes two arguments the core name of the original templates and the core name of the destination templates and creates appropriately named and permissioned copies. The program is located on wakko in home/cmanuel/bin.

#!/usr/bin/perl -w

use strict;

my $orig = shift @ARGV;
my $dest = shift @ARGV;

my @files = <*.$orig.tmpl>;

#print " -", join("\n -",@files), "\n";

unless (scalar @files) {
        die "no files matched '*.$orig.tmpl'";

my $count = 0;
foreach my $origfile (@files) {
        my $destfile = $origfile;
        $destfile =~ s/$orig/$dest/;
        my $cmd = "cp -p $origfile $destfile";
        #print $cmd,"\n";

-- CynthiaManuel - 31 May 2006

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding wiki.fini? Send feedback
Note: Please contribute updates to this topic on at TWiki:TWiki.ManagingTemplates