In bash, How can I force a flush of an incomplete line printed to the terminal
问题 I'm writing a script which does something like the following: echo -n "Doing stuff, wait for it... " do_stuff (($?==0)) && echo SUCCESS || echo FAILURE Excuse the poor bash skills. Anyway, the problem is that the first part of the line doesn't get printed until do_stuff is done - while it is important to me the user know what I'm running next. It is also important to me, since I'm pedantic, not to print a newline. So, the text is in the buffer and doesn't get flushed. This question is very