Hi All

Please tell me how to proceeed. I have been successfull with writing
the script for going through the directory and executing a command.

But I have tried in vain to modify this code to be able to
recursively run the command through the whole sub-directories, whichever is
there.

The following is the code I have started. Is this the right approach are
is there any simpler way of browsing through the directories.

#TEMPLATE TO BROWSE THROUGH A DIRECTORY STRUCTURE
$rootdir="C:/Temp/Test/";
chdir($rootdir);

#We are in /1/@
opendir(DIR1,$rootdir);

@dirfirstlevel=readdir(DIR1);

shift(@dirfirstlevel);
shift(@dirfirstlevel);
foreach $directory (@dirfirstlevel)
{
   if(-d $directory)
   {
       `copy $directory $directory.bak`;
        print "$directory\n";

        }
}

This code however assumes that the directory tree is fixed. How do I
do this when I do not know the depth of the directory C:/Temp/Test

I would like to copy  all the subdirectories under C:/Temp/Test to .bak

TIA and Regards
Jay




 Jayashankar N S
 Team Ulysses
 Transco ODC
 Wipro Technologies,
 # 72, Tower 6, First Floor,
 Keonics Electronic City, Hosur Road,
 Bangalore-561229,
 India.
 Board: 91-80-8520408, 8520416 Ext 6196
 Dial Com: 792

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***************************************************************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to