- Below code gives you an example to refresh multiple lines using tput
while :; do
echo "$RANDOM"
echo "$RANDOM"
echo "$RANDOM"
sleep 0.2
tput cuu1 # move cursor up by one line
tput el # clear the line
tput cuu1
tput el
tput cuu1
tput el
done
- Below code gives you an example to refresh or reprint same line on STDOUT
while true; do echo -ne "`date`\r"; done
Comments
Post a Comment