我的目标是从我的主shell运行一个程序,然后清除屏幕,显示这个新清除的shell中的所有输出,直到我的程序退出.那时,我不想在我的屏幕历史中看到这个程序的所有输出.但我不想失去以前的历史.
清除,重置,清除&& printf'\ e [3J'不起作用.Subshell保留历史记录,也不起作用.
谢谢
尝试这样的事情:
#!/bin/sh
tput smcup # Save the display
...
echo 'Your program stuff...'
...
tput rmcup # restore the display
Run Code Online (Sandbox Code Playgroud)