Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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
Replies are listed 'Best First'.
Re: Need help with recursive dir
by johngg (Abbot) on Oct 03, 2010 at 12:39 UTC
Re: Need help with recursive dir
by eyepopslikeamosquito (Chancellor) on Oct 03, 2010 at 10:29 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2015-11-28 08:43 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (740 votes), past polls