Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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
[Corion]: Heh. The JSON link for Strawberry releases gives me the idea that I should provide an RSS proxy so people can get notified when a new release is there...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-02-27 08:18 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (377 votes). Check out past polls.