Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: inplace edit

by archon (Monk)
on Mar 21, 2001 at 05:14 UTC ( [id://65934]=note: print w/replies, xml ) Need Help??


in reply to inplace edit

I'm guessing the problem is the $1 in your xargs command. xargs will automatically put the contents of the file as the arguments for you. You don't need the $1 which likely contains the offending '.'.

Try this instead:

find . -name '*.c' -exec perl -pi.bak -e 's/name1/name2' {} \;
If you wanted it all in perl, you could use the File::Find module after a simple find2perl.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-18 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found