Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Recursive File Substitution

by Abigail-II (Bishop)
on Jul 12, 2002 at 13:24 UTC ( [id://181259]=note: print w/replies, xml ) Need Help??


in reply to Re: Recursive File Substitution
in thread Recursive File Substitution

That's not going to work if you have filenames with spaces in them. Piping it through xargs -0 (and don't forget the -print0 option for find) works better, although you will still have problems with filenames ending or beginning with a pipe symbol, beginning with a greater than or less than symbol, files named -, or files beginning or ending with whitespace. All due to the magic open (All hail magic open!).

We can however do the substitution without a body:

find . -type f -print0 | xargs -0 perl -0777lpwi.bak -015e' '

Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-23 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found