Using tput to save, clear and restore the terminal contents
Using tput to save, clear and restore the terminal contents $ tput smcup; echo ”Doing some things…”; sleep 2; tput rmcup Very useful for interactive scripts where you would like to return the terminal contents to its original state before the script was run. This would be similar to how vi exits and returns you to your original terminal screen.
Save and clear the terminal contents with:
tput smcup
Continue reading