Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] how to use a script to replace text in a file?

OP washwash

19th June 2014, 05:48 PM   |  #1  
OP Member
Thanks Meter: 11
 
63 posts
Join Date:Joined: May 2014
More
i want to use a script to change text in build.prop
the script has to look for:

ro.something: (text to change)

and change the (text to change)

how?
20th June 2014, 06:45 PM   |  #2  
shimp208's Avatar
Recognized Contributor
Flag Boston
Thanks Meter: 1,689
 
2,321 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by washwash

i want to use a script to change text in build.prop
the script has to look for:

ro.something: (text to change)

and change the (text to change)

how?

One way would be to make use of the sed command in a script, coupled with other commands such as grep you can search for the property you want and replace the values of it once you find the property your looking for. I would recommend taking a look at the sed documentation, as well as this tool which does something similar to what you want to do.
The Following User Says Thank You to shimp208 For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes