在一个文件中我有这个结构:
192.168.1.53 # hostname, city, state
192.168.1.101 # hostname, city, state
192.168.1.10 # hostname, city, state
192.168.1.18 # hostname, city, state
192.168.1.19
192.168.1.104 # hostname, city, state
当没有“#”但在 ip 之后替换然后继续到缺少“#”的下一个时,我如何使用 sed 查找和替换。
所以它看起来像下面这样:
192.168.1.53 # hostname, city, state
192.168.1.101 # hostname, city, state
192.168.1.10 # hostname, city, state
192.168.1.18 # hostname, city, state
192.168.1.19 # newcontent, new, new
192.168.1.104 # hostname, city, state