sed -r 's/(ATTR\{address\}==")[^"]*/\1ABC/' A结果得到:SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ABC", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"