Funciona da maneira que faz porque o Unix é full-duplex. Como Ritchie disse em O Sistema de Compartilhamento de Tempo do UNIX: Uma Retrospectiva :
One thing that seems trivial, yet makes a surprising difference once one is used to it, is full-duplex terminal I/O together with read-ahead. Even though programs generally communicate with the user in terms of lines, rather than single characters, full-duplex terminal I/O means that the user can type at any time, even if the system is typing back, without fear of losing or garbling characters. With read-ahead, one need not wait for a response to every line. A good typist entering a document becomes incredibly frustrated at having to pause before starting each new line; for anyone who knows what he wants to say any slowness in response becomes psychologically magnified if the information must be entered bit-by-bit instead of at full speed.
[end quote]
Dito isto, existem alguns programas modernos que consomem ou descartam qualquer tipo de digitação; ssh
e apt-get
são dois exemplos. Se você digitar com antecedência enquanto estiver executando, poderá descobrir que a primeira parte de sua entrada desapareceu. Isso poderia ser um problema.
ssh remotehost do something that takes 20 seconds
mail bob
Dan has retired. Feel free to save any important files and then do
# ssh exits here, discarding the previous 2 lines
rm -fr *
.