How can I apply this sed command to a specific line in a text file instead of to the entire file?
I found a solution here for replacing any IP addresses in a file with a specific address. I need to apply this command to a specific line in the file so that it only replaces one single unknown IP address. I saw that sed uses -n to filter but I literally know nothing about how to apply this to achieve my goal.
This code works for every IP in the file:
sed -e 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/x.x.x.x/g' test.txt
How can I apply it to the only line in the file that also includes the string, "ipv4" so that other lines containing IP addresses are left unmodified?