Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Spaces in file names passed as arguments

by Utilitarian (Vicar)
on Sep 08, 2011 at 15:50 UTC ( #924843=note: print w/replies, xml ) Need Help??


in reply to Spaces in file names passed as arguments

Using find and double quoting the {} in an exec allows you to do the whole library in one pass
find ./ -name \*\ \* -exec perl -e ' for (@ARGV){$new=$_;$new=~s/\s+/_ +/g;rename($_,$new);}' "{}" \;
Works for me

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://924843]
help
Chatterbox?
[LanX]: horoba: you like ice hockey?
[choroba]: Like is a too strong word. But you can't evade it here.
LanX (for people wondering: yes field hockey still exists and is even more popular than Hasslhoff in Germany)
[Corion]: LanX: Ah, that explains a lot :)
[marto]: Nobody we spoke to in Berlin had a clue who Hasslhoff was
[erix]: heh: The Dutch do one thing very, very well
[LanX]: the sidekick of this blonde playboy model which was saving lives with her red bathing suit ... (what was her name again ...)
[choroba]: Pamela Anderson?
[choroba]: erix: I'm proud to be from a nation that also does one thing well
[LanX]: ah yes! And he called her Kit and she could talk while a light was going from her left to right eye and back...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2018-02-23 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (303 votes). Check out past polls.

    Notices?