Você pode limpar uma linha e usar o retorno de carro ( \r
) para chegar ao início da linha.
clr2eol='tput el' # capture escape sequence for "clear-to-end-of-line"
echo -n "Process A has started." # display without a newline
sleep 3
echo -n "\r${clr2eol}Process A is running." # move to beginning of line (bol), clear, and display new text
sleep 5
echo -n "\r${clr2eol}Process A has completed." # again, move to bol, clear and display new test
echo # terminating newline you may not want to have this sent right away
Leia a página de manual em terminfo
.