许多命令(例如watch、less)可以暂时清除tty以显示全屏信息,然后当命令退出时恢复原始的tty内容。
有办法在bash脚本中实现这一点吗?
发布于 2018-07-13 13:24:07
使用tput。下面是一个很小的例子:
#!/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 screenhttps://stackoverflow.com/questions/51324928
复制相似问题