![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Coping files from server to local | jhofilena | Shell Programming and Scripting | 3 | 09-19-2007 02:50 PM |
| For loop - coping with an asterisk item | PaulUrwin | Shell Programming and Scripting | 1 | 09-07-2007 03:01 AM |
| Cron won't run properly | Steeler_fan | UNIX for Dummies Questions & Answers | 2 | 08-31-2006 10:32 AM |
| coping all files from a directory | pavan_test | UNIX for Dummies Questions & Answers | 1 | 07-23-2006 05:35 AM |
| Coping filies from Linux Server to HP-UX Server | cgege | HP-UX | 2 | 04-12-2004 01:25 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 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;
}
}
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. Last edited by prashants; 11-19-2008 at 04:41 AM.. |
![]() |
| Bookmarks |
| Tags |
| command, copy, copying |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|