N秒ごとにループ印刷情報を含むスクリプトがあります
function exit_loop
{
tput rmcup
tput cnorm
exit 0
}
function main_loop
{
tput smcup
tput civis
trap exit_loop SIGINT
while [ true ]; do
sleep $DELAY &
clear
# do things and print
wait
done
}
前の作業は問題ありませんが、スクリプトが更新の間に印刷されている場合、ある種のダブルバッファが存在します。
ノート
echo -e
私のスクリプトは、およびprintf
文で出力に色を使用します