updated git and svn scripts
[xrzperl.git] / plcp
blob91854be9fb7d381c9e9b28a72f3a4212e0de2b9a
1 #!/usr/bin/perl -w
2 ###APPNAME: plcp
3 ###APPAUTHOR: root
4 ###APPDATE: Fri Sep 21 13:15:05 2007
5 ###APPVER: 0.1
6 ###APPDESC: copy perl script
7 ###APPUSAGE: (source name) (target name)
8 ###APPEXAMPLE: plcp plcp plcopy
9 ###APPOPTION:
10 use strict;
11 use lib $ENV{XR_PERL_MODULE_DIR};
12 use MyPlace::Script::ENV qw/$SRC_DIR/;
13 use MyPlace::Script::Usage qw/help_even_empty/;
14 exit 0 if help_even_empty($0,@ARGV);
15 my $srcFile="$SRC_DIR/$ARGV[0]";
16 my $dstFile;
18 if(-f $srcFile) {
19 $dstFile = "$SRC_DIR/$ARGV[1]";
21 else {
22 $srcFile = "$SRC_DIR/$ARGV[0].pl";
24 $dstFile = "$SRC_DIR/$ARGV[1]";
25 system("cp","-vi",$srcFile,$dstFile);
26 system("sed","-i", "-e", "s/$ARGV[0]/$ARGV[1]/g","$dstFile");