Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-01-22 03:34 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (231 votes). Check out past polls.