Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: renaming files question

by Happy-the-monk (Monsignor)
on Jan 06, 2006 at 13:25 UTC ( #521470=note: print w/ replies, xml ) Need Help??


in reply to renaming files question

If you don't care if there is more than one file with such a "middle extension" and want to run the risk of losing the others, this simple trick does it:

perl -wle 'for ( <1bn9.*.cnt> ) { qx(mv $_ 1bn9.cnt) }'

On the safe side, run it only once:

perl -wle '$_ = <1bn9.*.cnt>; qx(mv $_ 1bn9.cnt) if $_'

Cheers, Sören


Comment on Re: renaming files question
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://521470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2014-07-26 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (178 votes), past polls