更新时间:2023-02-23 12:54:19
您快到了!您要做的就是逃避重复括号:
You were almost there! All that you have to do is escape the repetition braces:
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
将文件中的所有 IP 地址替换为指定的字符串
将文件中的所有IP地址替换为指定的字符串