Hi,
I'm trying to copy the directories from one location(/tmp/source/) to other(/tmp/dest/).
for this I have written a PERL script.
snippet of code
$sourcePath = "/tmp/source";
$destPath = "/tmp/dest";
opendir(DIR, $sourcePath );
while($dir = readdir(DIR))
{
if($dir ne "." && $dir ne "..")
{
$sourceDir = $sourcePath . "/" . $dir;
$destDir = $destPath . "/" . $dir;
$cpCMD = "cp -rf $sourceDir $destDir";
system $cpCMD;
}
}
For Some directories it is working fine.
But for others the directories are created like /tmp/dest/report1/report1/files instead of /tmp/dest/report1/files.
If I'm not clear, Please revert.
can somebody help me?
Thanks in Advance.