Ok I have been all over the net and read books and still can't figure this one out, please someone show me the light.
I have a script that looks like:
I want to be able to find the lines that matches my input and change the N to a Y, but only for the lines that matches the name and not any other N's
My problem is the line does not always contain a P as it can be a D as well so my matching did not work.
If my script issues the name $1=triva the lines will change to:
I have the following code so far but as you can see it does not change the D's
sed -i 's/trivia:P:Y/trivia:P:N/g' servers.txt
*** UPDATE ***
should I be using a method as follows? I am still stuck on the changing all instances though.
sed -i 's/$server1:P:Y/$server:P:N/g' server.txt
sed -i 's/$server1:D:Y/$server:D:N/g' server.txt