Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,110 Members 40,236 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
washwash
Old
#1  
Member - OP
Thanks Meter 11
Posts: 57
Join Date: May 2014
Default [Q] how to use a script to replace text in a file?

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?
Kernel: nAa custom 720p (really working)
Rom: Super Jelly Bean™ 8.0
Phone: Mini Pro Unlocked BL
 
shimp208
Old
#2  
shimp208's Avatar
Recognized Contributor
Thanks Meter 1,545
Posts: 2,238
Join Date: Jan 2011
Location: Boston

 
DONATE TO ME
Quote:
Originally Posted by washwash View Post
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: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes