The first one does output something: the characters a, b and c followed by a carriage return. The c
suppresses all further output, including the newline that echo
normally prints after its arguments (You can get the same effect with echo -ne "abc
"
). Then after the command exits, the shell prints out your prompt. Because of the carriage return and no newline, this overwrites the 'abc'. If your prompt is shorter than what is printed out, you'll see the leftover characters after the prompt.
With the second one, adding the sleep 1
causes a delay before the commands exit, giving you time to see the text before it's overwritten with a shell prompt.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…