I need to do the following:
text in the format of:
ADDRESS=abcd123:1111
abcd123:1111
replace with: ADDRESS=localhost:2222
ADDRESS=localhost:2222
sed 's/ADDRESS=<What do I use here?>/ADDRESS=localhost:2222/g'
Everything I've tried ends up with:
ADDRESS=localhost:2222abcd123:1111
Thanks in advance.
sed 's/ADDRESS=.*/ADDRESS=localhost:2222/' myFile
sed 's/ADDRESS=[^:]*:..../ADDRESS=localhost:2222/g' file
Thanks I used the .* it works great. I have another one for you.
sed 's/Connector port=[^"8443" ^"8009" ^"8082"]/Connector port="2804"/g' server.xml | grep "Connector port="
I'm trying to get it to replace any that are not listed. I think it's the " that are causing the issue but adding a \ in from of each " does fix it. I've used this format before but not with any text with "" around them.