I have a file :
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,4433,465,587,993,995,3306,9200,8080,8888,10000:20000,"
# Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,53,80,110,113,143,443,465,4433,587,993,995,3306,9200,8080,8888,10000:20000,"
# Allow incoming UDP ports
UDP_IN = "20,21,53,111"
# Allow outgoing UDP ports
# To allow outgoing traceroute add 33434:33523 to this list
UDP_OUT = "20,21,53,113,123,111"
# Allow incoming PING. Disabling PING will likely break external uptime
# monitoring
ICMP_IN = "1"
I want to delete, lets say 443
from line starting with TCP_OUT = "
but not from anywhere else in the file.
a sed
or awk
solution would be what I am looking for.
Clarification :
I don't want to delete the entire line that starts with a specific string, I want to delete a sub string in a line that starts with a string. ex : I want to delete just the 443
in line that starts with TCP_OUT = "
I don't want to delete entire line that starts with TCP_OUT = "