i want to rewrite first line but tput is removing all lines instead of first line
im testing this
cl=$(tput ed)
tput sc
echo 'line1____'
echo 'line2____'
echo 'line3____'
sleep 1
tput rc
echo "abc$cl"
echo ''
echo ''
sleep 1
when done it should look like
abc
line2____
line3____
but it is doing
abc
-empty
-empty
I think what you want is
tput el(clear to end of line) instead oftput ed(clear to end of screen):From the man pages for
terminfo:When I make this one change (
cl=$(tput el)) to your code it now generates: