如何在长输出的端子上保持同一条线? [英] How to keep same line on terminal top with long output?
问题描述
在Ubuntu 14.04下,我正在编写一个脚本,该脚本输出很多文本(几个命令...),我想始终在终端屏幕顶部保留一行或多行以显示正在运行的标题. 换句话说,我尝试减少终端的垂直滚动区域并在该非滚动区域中进行书写.
Under Ubuntu 14.04, I'm writing a script that output a lot of text (several commands...), and I would like to keep one or more lines always on top of the terminal screen to display what's running title. In other words, I try to reduce terminal vertical scroll zone and write in that non-scrolling zone.
我该怎么做?我看到了使用循环逐行捕获输出的类似内容,但是我无法找到一种方法来告诉系统从第二行或第三行进行打印.
How can I do that? I saw similar stuff using a loop catching output line by line, but I'm unable to find a way to tell the system to print from let's say line 2 or 3.
感谢您的回答,
尼古拉斯
推荐答案
尼克,看来这样做很好.
Nic, it appears this does quite nicely.
http://www.tldp.org/HOWTO/Bash- Prompt-HOWTO/x361.html
这篇关于如何在长输出的端子上保持同一条线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!