Start of topic | Skip to actions
Managing Templatescptmpl 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"; system($cmd); $count++; }-- CynthiaManuel - 31 May 2006 |