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.
如果3,5p打印第 3、4 和 5 行,如何打印第 4 和 7 行,而不是第 5 和 6 行?
3,5p
试过:
3 5 p打印第 8 行
3 5 p
3p5p休息也
3p5p
ed通常不会让你像这样操纵不相交的线,所以你通常会这样做
ed
4p this is line 4 7p this is line 7
但是,ed确实允许在命令上下文中使用g//命令列表,因此如果您确实需要一个响应中的所有输出,您可以使用
g//
1g/^/4p\ 7p this is line 4 this is line 7
它很丑陋,它是一个黑客,而且打字不方便。但是,如果您确实确实需要一次完成所有输出,则可以这样做。