【发布时间】:2020-03-02 06:44:16
【问题描述】:
使用\hello 开始的一行被跳过
awk '/\\hello/{next}'
如何编辑上面的命令以跳过 \hello 和 \hello2 之间的行?
输入
text
\hello
text
hi
\hello2
text2
想要的输出:
text
text2
【问题讨论】:
-
如果没有
\hello2怎么办 - 是否应该打印以\hello开头的文本。并且没有模式 - 如果您在谈论字符串或正则表达式,请始终说明。
标签: awk