Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: changing name within a file

by greenFox (Vicar)
on Aug 30, 2002 at 00:38 UTC ( #193958=note: print w/replies, xml ) Need Help??

in reply to changing name within a file

If I understood correctly-

perl -pi.bak -e 's# :dir=\.\./(somthing.cpp)# :dir=\.\./mainDir/sudir/$1#' file

If you want to do this as part of a larger script take a look at Tie::File or Editing Files In Place

Update:added :dir=

Update:eeek! I just noticed that this node is awfully like this one have I failed dws's homework appeal?

Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://193958]
stevieb is writing a little CUFP on how to control analog pins on an arduino from a Linux machine via I2C in light of Perl, JavaScript and Strandbeests. It also is a good real-world use-case to test my I2C dist.
[stevieb]: I just don't feel like going hardcore on anything today, so I thought I'd *use* my software instead of just write it

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-07-21 23:22 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (336 votes). Check out past polls.