Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: rename subdirectories

by perlfan (Curate)
on Dec 04, 2007 at 19:45 UTC ( #654928=note: print w/replies, xml ) Need Help??

in reply to rename subdirectories

One of my favorite one-liners does the renaming thing, though I've never tested it it on subdirectories. FWIW:
find . | perl -ne'chomp; next unless -e; $oldname = $_; s/aaa/bbb/; ne +xt if -e; rename $oldname, $_'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://654928]
[GotToBTru]: hippo++
erix .oO( apparently but does not GotToBFast )
[Discipulus]: now i must come back to my house/hoven monks: dont do interesting discussion in my absence!
[erix]: or apparently, now it does :)
[GotToBTru]: heh
erix prods ambrus to (re-)start cbstream...
[GotToBTru]: I've got a program with an if ... or ... statement with 80 clauses
[stevieb]: 80 clauses? dispatch table?
[GotToBTru]: no, lookup

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2017-06-22 12:56 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.