举个例子:
类似显示最后两行
tail -2
D
Delete up to the first embedded newline in the pattern space. Start next cycle, but skip reading from the input if there is still data in the pattern space.
这个应该如何解释比较澳合理?
"but skip reading from the input" 这个不明白怎么解释.
不是最后一行就"N" 读取下一行追加到当前行,不是最后一行就"D"删除模式空间里面的第一个换行前的内容.
第一行 1 读入变成 1\n2, D操作是否变成2?
第三行 3 读入变成 3\n4, D操作后是否变成4?
如果是这样,那结果就变成
2
4
5
肯定是不对了.
想了N久实在没想明白,:em11: