Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Renaming all files in a directory

by choroba (Cardinal)
on Feb 02, 2021 at 13:19 UTC ( [id://11127812]=note: print w/replies, xml ) Need Help??


in reply to Renaming all files in a directory

If you don't want to use Perl's glob, use the shell's globbing instead of parsing the output of ls.
perl -we 'rename $_, "image" . $counter++ . ".jpg" for @ARGV' *
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-29 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found