How I search for strings with HTML tag like
< link type="text/css" rel="stylesheet"
href="https://teststore.xxxx.com/gwtstore.css">
In a index.html
file and replace that with
<link type="text/css" rel="stylesheet"
href="https://testsstore.xxxx.com/gwtstore.css">
Note: I just want to insert 'S'
in between teststore.
I did achieved that with perl syntax as
perl -i -p -e 's/teststore/testsstore/ if ($. == 28 || $. == 41)' index.html
My only concern is if the index.html file changes then the line number too will get change.. i dont want my script to exit. instead i need a way to search based on text strings instead of line no.
Any idea how to achive this.. A little brief would be highly helpful.