Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: renaming files

by graff (Chancellor)
on Dec 16, 2011 at 03:49 UTC ( #943872=note: print w/replies, xml ) Need Help??


in reply to renaming files

ls *.mp3 | perl -lne '($n=$_)=~s/(..).*/$1_my_guitar.mp3/; rename $_, +$n'
or
perl -e 'for (<*.mp3>){($n=$_)=~s/(..).*/$1_my_guitar.mp3/; rename $_, + $n}'
(both are untested)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://943872]
help
Chatterbox?
[marto]: shmem: I've not been awake all night, but it really hasn't stopped raining since early yesterday :)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-07-26 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (388 votes). Check out past polls.