bash script, erase previous line?

前端 未结 6 1279
暗喜
暗喜 2021-01-31 10:31

In lots of Linux programs, like curl, wget, and anything with a progress meter, they have the bottom line constantly update, every certain amount of time. How do I do that in a

6条回答
  •  星月不相逢
    2021-01-31 10:58

    man terminfo(5) and look at the "cap-nam" column.

    clr_eol=$(tput el)
    while true
    do
        printf "${clr_eol}your message here\r"
        sleep 60
    done
    

提交回复
热议问题