首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >临时清除tty

临时清除tty
EN

Stack Overflow用户
提问于 2018-07-13 12:17:08
回答 1查看 653关注 0票数 1

许多命令(例如watchless)可以暂时清除tty以显示全屏信息,然后当命令退出时恢复原始的tty内容。

有办法在bash脚本中实现这一点吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-13 13:24:07

使用tput。下面是一个很小的例子:

代码语言:javascript
复制
#!/bin/bash  
tput smcup    # save the screen
clear         # clear the screen

echo this is some text on a blank screen
echo press any button to exit..
read -n1

tput rmcup    # reset the screen
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51324928

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档