Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Put your inplace-edit backup files into a subdir

by Aristotle (Chancellor)
on Apr 21, 2003 at 12:05 UTC ( #251978=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    mkdir bak/ ; perl -pi'bak/*' -e 's/foo/bar/g' file1 file2 file3 ...
    
  2. or download this
    perl -pi'bak/*' -e 'BEGIN { mkdir($^I =~ m!(.*/)!) } s/foo/bar/g' file
    +1 file2 file3 ...
    
  3. or download this
    perl -MFile::Path -pi'bak/*' -e 'BEGIN { mkpath [ $^I =~ m!(.*/)! ] } 
    +s/foo/bar/g' file1 file2 file3 ...
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (18)
As of 2015-07-28 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (256 votes), past polls