Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Need help with recursive dir

by skandsp
on Oct 03, 2010 at 09:59 UTC ( #863160=perlquestion: print w/ replies, xml ) Need Help??
skandsp has asked for the wisdom of the Perl Monks concerning the following question:

I need help to do something like the the description below. I am very new to perl and need help with directory handling.

1. dir_source has around 20 sub directors (say sub1, sub2...sub20) 2. under a new path (say source_dir), need to create a new dir by name "dir_parent_sub1" 3. copy all files from dir_parent/sub1 dir to the new dir, source_dir/dir_parent_sub1 3. cd to source_dir/dir_parent_sub1 4. cp name.txt to name.txt.orig 5. go up one level to source_dir and change the permissions on the dir_parent_sub1 using chmod -R 770 dir_parent_sub1 6. repeat the steps 2-5 for all directories under dir_parent

Comment on Need help with recursive dir
Re: Need help with recursive dir
by eyepopslikeamosquito (Canon) on Oct 03, 2010 at 10:29 UTC
Re: Need help with recursive dir
by johngg (Abbot) on Oct 03, 2010 at 12:39 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://863160]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-07-06 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls