How to delete and replace last line in the terminal using bash?
The carriage return by itself only moves the cursor to the beginning of the line. That’s OK if each new line of output is at least as long as the previous one, but if the new line is shorter, the previous line will not be completely overwritten, e.g.: $ echo -e “abcdefghijklmnopqrstuvwxyz\r0123456789” 0123456789klmnopqrstuvwxyz To actually … Read more