Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 .bash 脚本并尝试从文件中删除行
sed -e s/^DNS1.*/''/g -i $DNS_IP_CONFIG_FILE
但仍然是空白行。我在这段代码中需要 baskspace
sed -i '/^DNS1.*/d' $DNS_IP_CONFIG_FILE
sed -i -e '/^DNS1/d' "$DNS_IP_CONFIG_FILE"
sed -i -ne '/^DNS1.*/!p' $DNS_IP_CONFIG_FILE