2010-12-27, 11:53(-07), Eric Blake: [...] >> So I think you can expect a non-zero status here. > > All you can expect is that you have undefined results. Undefined > results include zero status. [...]
Yes, sorry, you're right. Bad reasoning of mine. The >0 on EOF is oviously on end of text file, that is when there's nothing left to be read after the last newline character. On a terminal, you'd express that EOF by entering the eof character on an empty buffer. Having said that, all the implementations are returning a non-zero exit status on an unfinished line and it also sounds to me like the best option (as it allows to diffentiate a terminated line from an unfinished one and can also be seen as an error condition), so it would be unwise IMO for bash to change its behavior to return 0 in this case. -- Stephane