On 1/4/15 12:45 AM, isabella parakiss wrote: > I'm trying to use read -t in an interactive shell > > read -t 3 *press random keys* > > Everything i press is now part of the next command in the prompt. > It only happens when the delimiter is a \n. > Is this intended? What's the point?
It's difficult for me to tell what the question is here. You've asked for bash to read as much input as it can until it reads a newline, with the read aborted if you don't press a newline within three seconds. Since you don't press newline, read(2) doesn't return anything and whatever you've typed is left in the input buffer as typeahead for readline. When readline is called, it is able to read all of the typeahead and use it as part of the next input line. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/