我正在尝试设计一种方法,可以从给定字符开始删除至行末的所有文本。
例如,在下面的示例中,我只想保留IP地址:
192.168.2.121/32 -m comment --comment "blah blah bye bye" -j DROP
10.1.3.207 -m comment --comment "much longer comment with all kinds of stuff" -j DROP
172.16.1.0/24 -m comment --comment "Drop this range" -j DROP
需要删除的模式是-m
,即从左侧开始阅读,遇到第一个"-"。从该符号到行末的内容应在文件的每一行上被删除。
我对这个有困惑,希望能得到指导。
%norm 0dt<character>
。 - Lieven Keersmaekers%norm 0df<character>
- Lieven Keersmaekers